Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#ActualShawn619

Posted 12 June 2013 - 02:41 PM

My drawing goes like this:

//globals
GLuint shaderOne;
 
//init
shaderOne = initializeShader(...)
//end init

//drawing per frame 
 
//draw scene
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glViewport(0, 0, windowWidth, windowHeight);
glClearColor(0,0.5,0.5,0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0, (float)windowWidth / (float)windowHeight, 0.4, 9000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
 
 
 
//enables/disables
glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
 
//start shader
glUseProgram(shaderOne);
 
 
//set camera
gluLookAt(cam.posX,cam.posY,cam.posZ,cam.viewX,cam.viewY,cam.viewZ,cam.upX,cam.upY,cam.upZ);
 
//draw calls
//...
 
 
//end shader
glUseProgram(0);


glutSwapBuffers();

//end drawing per frame








#1Shawn619

Posted 12 June 2013 - 02:40 PM

My drawing goes like this:

//globals
GLuint shaderOne;
 
//init
shaderOne = initializeShader(...)
 
//drawing per frame
 
 
//draw scene
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glViewport(0, 0, windowWidth, windowHeight);
glClearColor(0,0.5,0.5,0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0, (float)windowWidth / (float)windowHeight, 0.4, 9000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
 
 
 
//enables/disables
glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
 
//start shader
glUseProgram(shaderOne);
 
 
//set camera
gluLookAt(cam.posX,cam.posY,cam.posZ,cam.viewX,cam.viewY,cam.viewZ,cam.upX,cam.upY,cam.upZ);
 
//draw calls
//...
 
 
//end shader
glUseProgram(0);
 
glutSwapBuffers();

PARTNERS