I am a little unsure as to what exactly is going on with this, but basically I have the following code:

Code :
#include "SDL/SDL.h"
#include "Button.h"
#include "SDL/SDL_opengl.h"
#include <iostream>
 
using namespace std;
 
const int SCREENWIDTH  = 800;
const int SCREENHEIGHT = 600;
 
void buttonAction()
{
    cout<<"Button Pressed"<<endl;
}
 
void init_GL(int width, int height)
{
    glClearColor( 0, 0, 0, 0 );
    glMatrixMode( GL_PROJECTION );
    glLoadIdentity();
    glOrtho( 0, width, height, 0, -1, 1 );
    glMatrixMode( GL_MODELVIEW );
    glLoadIdentity();
}
 
int main( int argc, char* args[] )
{
    //The images
    SDL_Surface* hello  = NULL;
    SDL_Surface* screen = NULL;
    bool         quit   = false;
    SDL_Event    event;
 
    int screenWidth  = SCREENWIDTH;
    int screenHeight = SCREENHEIGHT;
 
    //Start SDL
    SDL_Init( SDL_INIT_EVERYTHING );
 
    //Set up screen
    screen = SDL_SetVideoMode( screenWidth, screenHeight, 32, SDL_OPENGL | SDL_RESIZABLE );
 
    //Start OpenGL
    init_GL(screenWidth, screenHeight);
 
 
    SDL_WM_SetCaption( "Button Test", NULL );
    Button button(30, 30, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", *&buttonAction);
 
    //While the user hasn't quit
    while( quit == false )
    {
 
 
            //If there's events to handle
            if( SDL_PollEvent( &event ) )
            {
                if(event.type == SDL_VIDEORESIZE)
                {
                    screenWidth  = event.resize.w;
                    screenHeight = event.resize.h;
 
                    glViewport(0, 0, screenWidth, screenHeight);
                    glMatrixMode( GL_PROJECTION );
                    glLoadIdentity();
                    glOrtho( 0, screenWidth, screenHeight, 0, -1, 1 );
                    glMatrixMode( GL_MODELVIEW );
                    glLoadIdentity();
                }
 
                //Handle button events
                button.handleEvents(event);
 
                //If the user has Xed out the window
                if( event.type == SDL_QUIT )
                {
                    //Quit the program
                    quit = true;
                }
            }
 
        glPushMatrix();
 
            //Fill the screen black
            glBegin( GL_QUADS );
                glColor4f( 0.0, 0.0, 0.0, 1.0 );
                glVertex3f( 0, 0, 0 );
                glVertex3f( screenWidth, 0, 0 );
                glVertex3f( screenWidth, screenHeight, 0 );
                glVertex3f( 0, screenHeight, 0 );
            glEnd();
 
            //Show the button
            button.draw();
 
        glPopMatrix();
 
        //Update the screen
        SDL_GL_SwapBuffers();
    }
 
    //Quit SDL
    SDL_Quit();
 
    return 0;
}

and when i first draw everything seems to be working fine, and looks like this:
Click image for larger version. 

Name:	opengldrawing1.jpg 
Views:	32 
Size:	5.2 KB 
ID:	795

but when i resize i see the following:
Click image for larger version. 

Name:	opengldrawing2.jpg 
Views:	35 
Size:	19.3 KB 
ID:	796

any idea as to what is causing my problem?

Thank you for your time!
Brandon Murphy