Hi, I programin whit C# and OpenGL, but I have one problam. I don't find wha't is wrong. Windows is white, don't do enything.
What's wrong?
And maybe some no good OpenGL+C# book for beginner? -
using System;
-
using System.Collections.Generic;
-
using System.Text;
-
using Tao.OpenGl;
-
-
namespace image
-
{
-
class Begin
-
{
-
static void Main(string[] args)
-
{
-
Glut.glutInit();
-
Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB);
-
-
Glut.glutInitWindowSize(400, 400);
-
Glut.glutInitWindowPosition(400, 300);
-
Glut.glutCreateWindow("Image");
-
-
Init();
-
-
Glut.glutDisplayFunc(new Glut.DisplayCallback(Show));
-
-
Glut.glutMainLoop();
-
-
}
-
-
static void Init()
-
{
-
Gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
-
}
-
-
static void Show()
-
{
-
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT); //Clear buffer
-
-
float[] mas_quad = { -0.5f, -0.5f, -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f };
-
float[] color_mas = { 0.5f, 0.1f, 0.5f, 0.5f, 0.1f, 0.6f, 0.0f, 0.8f, 0.0f, 0.0f, 0.5f, 4.0f };
-
Gl.glVertexPointer(2, Gl.GL_FLOAT, 0, mas_quad);
-
Gl.glColorPointer(3, Gl.GL_FLOAT, 0, color_mas);
-
Gl.glBegin(Gl.GL_POLYGON);
-
for (int i = 0; i < 4; i++)
-
Gl.glArrayElement(i);
-
Gl.glEnd();
-
Gl.glFlush();
-
}
-
}
-
}
-
0 1889 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Rick Muller |
last post by:
I have a problem that I would like to get some advice on from other
Pythonistas. I currently manage a (soon to be) open source project for
displaying molecular graphics for a variety of different...
|
by: oracle411 |
last post by:
Hi I'm new to OpenGL, but have an OpenGL application written in CPP
that I would like to display on a web browser.
Was wondering how this could be done?
Thank you very much
|
by: Michael Sgier |
last post by:
Hi
OpenGL in VC7. I get errors with the default include gl file. Which and
where to get
working OpenGL files?
I also get errors with glfunctions in Kdevelop. Any help here?
Thanks indeed....
|
by: john townsley |
last post by:
Hi
I want to do some OpenGl stuff with c++ on a winXP (home) machine.
I have Borland c++ 5, MVS c++ 5
What C++ do you recommend (any others?)and where do you get the OpenGL
stuff.
thanks
|
by: Bad_Kid |
last post by:
which is better for what?
|
by: Scott Chang |
last post by:
Hi all,
I tried to use Managed C++ coding of VC++.NET (2002)and
OpenGL version 1.2 to draw a hexagon shape of benzene.
My OpenGLdrawBenzene.cpp is the following:
// This is the main project file...
|
by: tobfon |
last post by:
I'm creating a scientific visualization application with rather high
demands on performance. I've created a nice rendering engine for it in
C++/OpenGL and a python interface to the rendering...
|
by: jg.campbell.ng |
last post by:
I'm beginning learning Python and OpenGL in Python.
Python fine. But difficulties with OpenGL; presumably with the
installation of OpenGL.
OS = Linux FC5.
Python program gl_test.py:
from...
|
by: Achim Domma |
last post by:
Hi,
I'm developing a GUI app in Python/C++ to visualize numerical results.
Currently I'm using Python 2.4 with wx and PyOpenGLContext, but there
are no windows binaries for Python 2.5 for quite...
|
by: Leon |
last post by:
Hey, i am trying to develop a game, and I am using OpenGL and pthread.
(on Ubuntu, so i also use the X library.) Now i have a problem. I have
initialized OpenGL in the main thread, and i want to...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |