Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualBrother Bob

Posted 22 July 2013 - 12:14 PM

If you go to the following website and grab the very first example, you will have a Visual Studio project that creates a window using OpenGL. I ran it using Visual Studio 10 Express.  It builds and runs without any extra dependencies, I went to some trouble to find something that would run right away without any hassle or setup nonsense, this is it.

 

http://www.codesampler.com/oglsrc/oglsrc_1.htm#ogl_primitive_types

 

If you then go all the way to the bottom to the Render Function you will see the following

//========================================================================================================

void render( void )
{
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
 
// Render geometry here...
 
SwapBuffers( g_hDC );
}

//========================================================================================================

If you change it to look like the following, you will have the beginning of that Pong game that you mentioned making.  

It will be nice and plain old boring looking like you want.   A white square on a black background.  

The following  code that I added in comes from the first chapter of the OpenGL Redbook.  Found here.

 

http://fly.cc.fer.hr/~unreal/theredbook/

 

//========================================================================================================

 

void render( void )
{
       glClearColor(0.0, 0.0, 0.0, 0.0);
       glClear(GL_COLOR_BUFFER_BIT);
       glColor3f(1.0, 1.0, 1.0);
       glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); 
       //-------------------------------------------
      glBegin(GL_POLYGON);
              glVertex2f(-0.5, -0.5);
              glVertex2f(-0.5, 0.5);
              glVertex2f(0.5, 0.5);
              glVertex2f(0.5, -0.5);
       glEnd();
       //-------------------------------------------
 
 
  SwapBuffers( g_hDC );
}

//========================================================================================================


#3marcClintDion

Posted 22 July 2013 - 03:33 AM

There is far too much arrogance and out right abuse by site moderators, they are teaching other people to behave this way.  The posts I've made will all be shorty removed and replaced with this notice.  Game development is not the only thing being taught here, bad behavior is being taught as well.


#2marcClintDion

Posted 27 June 2013 - 06:33 PM

If you go to the following website and grab the very first example, you will have a Visual Studio project that creates a window using OpenGL. I ran it using Visual Studio 10 Express.  It builds and runs without any extra dependencies, I went to some trouble to find something that would run right away without any hassle or setup nonsense, this is it.

 

http://www.codesampler.com/oglsrc/oglsrc_1.htm#ogl_primitive_types

 

If you then go all the way to the bottom to the Render Function you will see the following

//========================================================================================================

void render( void )
{
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
 
// Render geometry here...
 
SwapBuffers( g_hDC );
}

//========================================================================================================

If you change it to look like the following, you will have the beginning of that Pong game that you mentioned making.  

It will be nice and plain old boring looking like you want.   A white square on a black background.  

The following  code that I added in comes from the first chapter of the OpenGL Redbook.  Found here.

 

http://fly.cc.fer.hr/~unreal/theredbook/

 

//========================================================================================================

 

void render( void )
{
       glClearColor(0.0, 0.0, 0.0, 0.0);
       glClear(GL_COLOR_BUFFER_BIT);
       glColor3f(1.0, 1.0, 1.0);
       glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); 
       //-------------------------------------------
      glBegin(GL_POLYGON);
              glVertex2f(-0.5, -0.5);
              glVertex2f(-0.5, 0.5);
              glVertex2f(0.5, 0.5);
              glVertex2f(0.5, -0.5);
       glEnd();
       //-------------------------------------------
 
  
  SwapBuffers( g_hDC );
}

//========================================================================================================


#1marcClintDion

Posted 27 June 2013 - 06:30 PM

If you go to the following website and grab the very first example, you will have a Visual Studio project that creates a window using OpenGL.  It builds and runs without any extra dependancies, I went to some trouble to find something that would run right away without any hassle or setup nonsense.  This is it.

 

http://www.codesampler.com/oglsrc/oglsrc_1.htm#ogl_primitive_types

 

If you then go all the way to the bottom to the Render Function you will see the following

//========================================================================================================

void render( void )
{
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
 
// Render geometry here...
 
SwapBuffers( g_hDC );
}

//========================================================================================================

If you change it to look like the following, you will have the beginning of that Pong game that you mentioned making.  

It will be nice and plain old boring looking like you want.   A white square on a black background.  

The following  code that I added in comes from the first chapter of the OpenGL Redbook.  Found here.

 

http://fly.cc.fer.hr/~unreal/theredbook/

 

//========================================================================================================

 

void render( void )
{
       glClearColor(0.0, 0.0, 0.0, 0.0);
       glClear(GL_COLOR_BUFFER_BIT);
       glColor3f(1.0, 1.0, 1.0);
       glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); 
       //-------------------------------------------
      glBegin(GL_POLYGON);
              glVertex2f(-0.5, -0.5);
              glVertex2f(-0.5, 0.5);
              glVertex2f(0.5, 0.5);
              glVertex2f(0.5, -0.5);
       glEnd();
       //-------------------------------------------
 
  
  SwapBuffers( g_hDC );
}

//========================================================================================================


PARTNERS