예제 #1
0
int InitGL(GLvoid)										// All Setup For OpenGL Goes Here
{
	glEnable(GL_TEXTURE_2D);							// Enable Texture Mapping
	glShadeModel(GL_SMOOTH);							// Enable Smooth Shading
	glClearColor(0.05f, 0.05f, 0.05f, 0.5f);			// Black Background
	glClearDepth(1.0f);									// Depth Buffer Setup
	glEnable(GL_DEPTH_TEST);							// Enables Depth Testing
	glDepthFunc(GL_LEQUAL);								// The Type Of Depth Testing To Do
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);	// Really Nice Perspective Calculations

	initBezier();											// Initialize the Bezier's control grid
	NeHeLoadBitmap("../../data/NeHe.bmp",mybezier.texture);	// Load the texture
	mybezier.dlBPatch = genBezier(mybezier, divs);			// Generate the patch

	return TRUE;										// Initialization Went OK
}
예제 #2
0
int initGL()						/*  All Setup For OpenGL Goes Here */
{
	glEnable(GL_TEXTURE_2D);				/*  Enable Texture Mapping */
	glShadeModel(GL_SMOOTH);				/*  Enable Smooth Shading */
	glClearColor(0.05f, 0.05f, 0.05f, 0.5f);		/*  Black Background */
	glClearDepth(1.0f);					/*  Depth Buffer Setup */
	glEnable(GL_DEPTH_TEST);				/*  Enables Depth Testing */
	glDepthFunc(GL_LEQUAL);					/*  The Type Of Depth Testing To Do */
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);	/*  Really Nice Perspective Calculations */

	initBezier();						/*  Initialize the Bezier's control grid */
	LoadGLTexture(&(mybezier.texture), "./data/NeHe.bmp");	/*  Load the texture */
	mybezier.dlBPatch = genBezier(mybezier, divs);		/*  Generate the patch */

	resizeGLScene(GLWin.width, GLWin.height);
	glFlush();

	return True;						/*  Initialization Went OK */
}