Jump to content

  • Log In with Google      Sign In   
  • Create Account


code displays only transparent window


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 flame_warrior   Members   -  Reputation: 122

Like
Likes
Like

Posted 30 June 2001 - 12:33 AM

Hi, I am just learning OpenGL. The code is right out of the OpenGL superbible. // Simple.c // The Simplest OpenGL program with GLUT // OpenGL SuperBible, 2nd Edition // Richard S. Wright Jr. #include #include // Called to draw scene void RenderScene(void) { // Clear the window with current clearing color glClear(GL_COLOR_BUFFER_BIT); // Flush drawing commands glFinish(); } // Setup the rendering state void SetupRC(void) { glClearColor(0.0f, 0.0f, 1.0f, 1.0f); } // Main program entry point void main(void) { glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutCreateWindow("Simple"); glutDisplayFunc(RenderScene); SetupRC(); glutMainLoop(); } When I compile this I get a transparent window. If I use glutSwapBuffers() and GLUT_DOUBLE, I get black background and not blue background ? Thank you.

Sponsor:

#2 Redge   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 July 2001 - 03:30 AM

first point, you''re windows isn''t transparent, it had been initialised with what you have in your video memory. if you move your windows, you will see...

second point, I don''t know. Are you sure the alpha value is 1.0f ? perhaps it''s 0.0f
you use GLUT_RGB, perhaps it should be GLUT_RGBA or something like that? or try to use glClearColor3f(glFloat R, glFloat G, glFloat B) I think this function exist.

Redge

#3 grady   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 July 2001 - 04:28 AM

I think that should be glutInitDisplayMode(GLUT_SINGLE|GL_RGB);

maybe you need to call glFlush(); after glFinish();

and you need a glClearColor(1.0f, 1.0f, 1.0f, 1.0f); i think

#4 zedzeek   Members   -  Reputation: 528

Like
Likes
Like

Posted 04 July 2001 - 11:14 AM

i dont see a resize function. theres a minimum num of functions that are needed in each glut program + IIRC resize is one of them

http://members.xoom.com/myBollux




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS