GIDForums  

Go Back   GIDForums > Computer Programming Forums > OpenGL Programming
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 30-Jun-2009, 12:52
thekilla1234 thekilla1234 is offline
New Member
 
Join Date: Jun 2009
Posts: 1
thekilla1234 is on a distinguished road

OpenGL GLUT program window not loading


I bought the OpenGL Superbible Fourth Edition and I have reached the 'Your First Program' section (Listing 2.1 for reference). I spent a while getting all the libraries setup and the program finally compiles with no warnings or errors, but when I run the program, the window doesn't load up, there is just a blank console window. I copied the code pretty much word for word (with the exception of a char* constant for the window title). Here is the code:

CPP / C++ / C Code:
/********** OpenGL Includes ********/
#include <gl/gltools.h>
/***********************************/

/********** Constants **************/
const char* WINDOW_TITLE = "OpenGL Test Program";
/***********************************/

/********** Draws the Scene ********/
void RenderScene()
{
	// Clear the window
	glClear(GL_COLOR_BUFFER_BIT);

	// Flush drawing commands
	glFlush();
}
/***********************************/

/****** Setup Rendering State ******/
void SetupRC()
{
	glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
}
/***********************************/

int main(int argc, char* argv[])
{
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
	glutCreateWindow(WINDOW_TITLE);
	glutDisplayFunc(RenderScene);
	SetupRC();

	glutMainLoop();

	return 0;
}

I am running on Vista using the Borland C++ compiler. As mentioned, the program complies fine using the command line:

Code:
bcc32 -DWIN32 ogl.cpp glut32.lib glu32.lib opengl32.lib

I have tried adding -L to each of the libraries and I get the same problem of the window not loading. I can't advance further into the book until this is sorted and I have searched high and low for someone with a similar problem and have found nobody, so I guess I'm a first. Does anyone understand why the window does not show?
 
 

Recent GIDBlogInstall Adobe Flash - Without Administrator Rights by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Equation solver RazoR C Programming Language 3 18-May-2008 09:24
Two-Tier data dissemination code installation problem nidhibansal1984 Computer Software Forum - Linux 6 16-Sep-2007 10:13
need help with a console menu system BullBuchanan C++ Forum 6 20-Aug-2006 14:46
Help with a complex program lordfuoco C++ Forum 5 24-Jun-2006 06:03

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:01.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.