void Graphics::Init() { Debug::Log("Graphics::Init"); if (GLEW_OK != glewInit()) { // GLEW failed! Debug::Log("glewInit failed!"); exit(1); } glEnable(GL_BLEND); glDisable(GL_LIGHTING); glEnable(GL_TEXTURE_2D); glCullFace(GL_BACK); //glShadeModel(GL_SMOOTH); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClearDepth(1.0f); glDisable(GL_DEPTH_TEST); //glDepthFunc(GL_LEQUAL); //glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //clear screen glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); ShowBuffer(); Set2D(800,600); //cameraPosition = screenCenter; //cameraZoom = Vector2::one; }
void Console::Show(void) { EnterCriticalSection(&Vars.cConsoleSection); ShowBuffer(); ShowPrompt(); LeaveCriticalSection(&Vars.cConsoleSection); }
void Console::ToggleBuffer(void) { if(!IsVisible()) ShowBuffer(); else HideBuffer(); }
void Console::ShowPrompt(void) { EnterCriticalSection(&Vars.cConsoleSection); enabled = true; if (!IsVisible()) ShowBuffer(); LeaveCriticalSection(&Vars.cConsoleSection); }
void Console::ToggleBuffer(void) { EnterCriticalSection(&Vars.cConsoleSection); if (!IsVisible()) ShowBuffer(); else HideBuffer(); LeaveCriticalSection(&Vars.cConsoleSection); }
void Console::ShowPrompt(void) { EnterCriticalSection(&Vars.cConsoleSection); enabled = true; if(!IsVisible()) ShowBuffer(); prompt->SetIsVisible(true); cursor->SetIsVisible(true); text->SetIsVisible(true); LeaveCriticalSection(&Vars.cConsoleSection); }
void Platform::Update() { XEvent event; while (XPending(LinuxPlatform::instance->hDisplay)) { XNextEvent(LinuxPlatform::instance->hDisplay, &event); switch(event.type) { case Expose: glViewport(0, 0, width, height); ShowBuffer(); break; case KeyPress: break; } } }