Does not Refresh??? Please help

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
zecryan
In need of some credit
In need of some credit
Posts: 6
Joined: Thu Jan 06, 2005 7:36 pm

Does not Refresh??? Please help

Post by zecryan »

ok here is my code for the project:

Code: Select all

#include "PrecompiledHeaders.h"
#include "MainApp.h"
#include "GameWindow.h"
#include "GLCanvas.h"

int Default_Window_Value = -1;

DWORD Default_GL_Style = wxNO_BORDER;

wxString Empty_String;

IMPLEMENT_APP( MainApp );

bool MainApp::OnInit()
{

	int Default_Window_Value = -1;
	DWORD Default_GL_Style = wxNO_BORDER;
	wxString Empty_String;
	
	MainGameWindow *GameWindow = new MainGameWindow( _T ( "Stromgage Game Engine" ), wxPoint( 100, 100 ), wxSize( 800, 600 ) );

	GLCanvas *MainGLWindow = new GLCanvas( GameWindow, Default_Window_Value, wxPoint( 0, 0 ), wxSize( 800, 600 ), Default_GL_Style, Empty_String );

	GameWindow -> Show( true );

	MainGLWindow -> SetCurrent();

	glClearColor(0.0, 0.0, 0.0, 0.0);
	glColor3f(1.0, 1.0, 1.0);

	glBegin(GL_TRIANGLES);
		glColor3f(.16f, .20f, .36f);
		glVertex3f( -0.5f, -0.5f, 1.0f);
		glColor3f(.54f, .91f, .82f);
		glVertex3f(-0.5, 0.5, 1.0f);
		glColor3f(.13f, .67f, .26f);
		glVertex3f(0.5, 0.5, 1.0f);

	 glEnd();
	glFlush();

	MainGLWindow -> SwapBuffers();

	return true;
	
}
now that compiles fine and runs but if i min the screen and then come back to screen it is blank, just a tanish colour. why does this happen? and how can i fix it.
Post Reply