Original Post
I am haveing trouble with this wxWidgets problem. what I want to do is when wxWidgets in Implemented, I want to to setup the Gamewindow frame and put a GLCanvas on the gamewindow. then i will start my game loop but i can not access the GLCanvas. is there any way i can access the GLWindow like this? Mainpp.cpp: mainApp.h:
#include "PrecompiledHeaders.h"
#include "MainApp.h"
#include "GameWindow.h"
#include "GLCanvas.h"
int Default_Window_Value = -1;
int Game_State = 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 *GLWindow = new GLCanvas( GameWindow, Default_Window_Value, wxPoint( 0, 0 ), wxSize( 800, 600 ), Default_GL_Style, Empty_String );
GameWindow -> Show( true );
GLWindow -> SetCurrent();
// StartGame();
return true;
}
/*void MainApp::StartGame()
{
while(GameState != 1)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
GLWindow -> SwapBuffer();
}
}*/
#ifndef MAINAPP_H
#define MAINAPP_H
#include "PrecompiledHeaders.h"
class MainApp : public wxApp
{
public:
virtual bool OnInit();
void StartGame();
private:
wxWindow GameWindow;
};
#endif