Fixed the files so they compile...

Had to add an argument to Create_window... (it was missing the sterio flag)

Also cleaned up some variable overloading warnings...
(i.e. window shadows previous def)

Kent
This commit is contained in:
2002-12-16 10:57:08 +00:00
parent 4a9377a861
commit a5b42eb626
2 changed files with 25 additions and 24 deletions

View File

@@ -46,6 +46,8 @@
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#define FALSE 0
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
@@ -66,6 +68,7 @@
static void gearsTimerProc(GHOST_TimerTaskHandle task, GHOST_TUns64 time); static void gearsTimerProc(GHOST_TimerTaskHandle task, GHOST_TUns64 time);
int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData);
static GLfloat view_rotx=20.0, view_roty=30.0, view_rotz=0.0; static GLfloat view_rotx=20.0, view_roty=30.0, view_rotz=0.0;
static GLfloat fAngle = 0.0; static GLfloat fAngle = 0.0;
@@ -78,7 +81,6 @@ static GHOST_WindowHandle sFullScreenWindow = NULL;
static GHOST_TimerTaskHandle sTestTimer; static GHOST_TimerTaskHandle sTestTimer;
static GHOST_TimerTaskHandle sGearsTimer; static GHOST_TimerTaskHandle sGearsTimer;
static void testTimerProc(GHOST_TimerTaskHandle task, GHOST_TUns64 time) static void testTimerProc(GHOST_TimerTaskHandle task, GHOST_TUns64 time)
{ {
printf("timer1, time=%d\n", (int)time); printf("timer1, time=%d\n", (int)time);
@@ -345,7 +347,7 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
*/ */
sFullScreenWindow = GHOST_BeginFullScreen(shSystem, &setting, sFullScreenWindow = GHOST_BeginFullScreen(shSystem, &setting,
false /* stereo flag */); FALSE /* stereo flag */);
} }
else else
{ {
@@ -400,8 +402,8 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
case GHOST_kEventWindowClose: case GHOST_kEventWindowClose:
{ {
GHOST_WindowHandle window = GHOST_GetEventWindow(hEvent); GHOST_WindowHandle window2 = GHOST_GetEventWindow(hEvent);
if (window == sMainWindow) if (window2 == sMainWindow)
{ {
sExitRequested = 1; sExitRequested = 1;
} }
@@ -412,7 +414,7 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
GHOST_RemoveTimer(shSystem, sGearsTimer); GHOST_RemoveTimer(shSystem, sGearsTimer);
sGearsTimer = 0; sGearsTimer = 0;
} }
GHOST_DisposeWindow(shSystem, window); GHOST_DisposeWindow(shSystem, window2);
} }
} }
break; break;
@@ -425,15 +427,12 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
break; break;
case GHOST_kEventWindowUpdate: case GHOST_kEventWindowUpdate:
{ {
GHOST_WindowHandle window = GHOST_GetEventWindow(hEvent); GHOST_WindowHandle window2 = GHOST_GetEventWindow(hEvent);
if (!GHOST_ValidWindow(shSystem, window)) if (!GHOST_ValidWindow(shSystem, window2))
break; break;
//if (!m_fullScreenWindow) setViewPortGL(window2);
{ drawGL();
setViewPortGL(window); GHOST_SwapWindowBuffers(window2);
drawGL();
GHOST_SwapWindowBuffers(window);
}
} }
break; break;
@@ -465,7 +464,8 @@ int main(int argc, char** argv)
320, 320,
200, 200,
GHOST_kWindowStateNormal, GHOST_kWindowStateNormal,
GHOST_kDrawingContextTypeOpenGL); GHOST_kDrawingContextTypeOpenGL,
FALSE);
if (!sMainWindow) if (!sMainWindow)
{ {
printf("could not create main window\n"); printf("could not create main window\n");
@@ -480,7 +480,8 @@ int main(int argc, char** argv)
320, 320,
200, 200,
GHOST_kWindowStateNormal, GHOST_kWindowStateNormal,
GHOST_kDrawingContextTypeOpenGL); GHOST_kDrawingContextTypeOpenGL,
FALSE);
if (!sSecondaryWindow) if (!sSecondaryWindow)
{ {
printf("could not create secondary window\n"); printf("could not create secondary window\n");

View File

@@ -606,12 +606,12 @@ bool Application::processEvent(GHOST_IEvent* event)
case GHOST_kEventWindowClose: case GHOST_kEventWindowClose:
{ {
GHOST_IWindow* window = event->getWindow(); GHOST_IWindow* window2 = event->getWindow();
if (window == m_mainWindow) { if (window2 == m_mainWindow) {
m_exitRequested = true; m_exitRequested = true;
} }
else { else {
m_system->disposeWindow(window); m_system->disposeWindow(window2);
} }
} }
break; break;
@@ -626,21 +626,21 @@ bool Application::processEvent(GHOST_IEvent* event)
case GHOST_kEventWindowUpdate: case GHOST_kEventWindowUpdate:
{ {
GHOST_IWindow* window = event->getWindow(); GHOST_IWindow* window2 = event->getWindow();
if(!m_system->validWindow(window)) if(!m_system->validWindow(window2))
break; break;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if(stereo) if(stereo)
{ {
View(window, stereo, LEFT_EYE); View(window2, stereo, LEFT_EYE);
glPushMatrix(); glPushMatrix();
RenderCamera(); RenderCamera();
RenderScene(); RenderScene();
glPopMatrix(); glPopMatrix();
View(window, stereo, RIGHT_EYE); View(window2, stereo, RIGHT_EYE);
glPushMatrix(); glPushMatrix();
RenderCamera(); RenderCamera();
RenderScene(); RenderScene();
@@ -648,13 +648,13 @@ bool Application::processEvent(GHOST_IEvent* event)
} }
else else
{ {
View(window, stereo); View(window2, stereo);
glPushMatrix(); glPushMatrix();
RenderCamera(); RenderCamera();
RenderScene(); RenderScene();
glPopMatrix(); glPopMatrix();
} }
window->swapBuffers(); window2->swapBuffers();
} }
break; break;