int GenericSLM::Initialize() { if (!initialized_) { if (chosenDisplayIndex_ == -1) return DEVICE_NOT_CONNECTED; LogMessage("GenericSLM::Initialize()"); stringstream msg; displays_[chosenDisplayIndex_].isSLM = true; msg << "Graphics Port: " << displays_[chosenDisplayIndex_].deviceName; this->LogMessage(msg.str().c_str()); if (! displays_[chosenDisplayIndex_].isDisabled) { DetachDisplayDevice(&displays_[chosenDisplayIndex_]); } POINT pos = getNextDisplayPosition(displays_); displays_[chosenDisplayIndex_].x = pos.x; displays_[chosenDisplayIndex_].y = pos.y; AttachDisplayDevice(&displays_[chosenDisplayIndex_]); viewBounds = getViewingMonitorsBounds(displays_); DeployWindow(); Sleep(500); // Wait for the adapter hardware to get fully attached. FixWindows(wnd_); SetWindowPos(wnd_, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); thd_ = new GenericSLMWindowsGUIThread(wnd_); thd_->Start(); InitializeDrawContext(); initialized_=true; } return HandleErrors(); }
// Initialization functions void GameApp::InitApp(void) { #ifndef GL_ARB_texture_non_power_of_two printf("DOES NOT SUPPORT NON POWER OF TWO!!\n"); #else printf("DOES SUPPORT NON POWER OF TWO!!\n"); #endif printf("InitApp...\n"); ResW = 600; ResH = 600; // ilInit(); InitializeSDL(); InitializeDrawContext(ResW, ResH); ResetGame(); InstallTimer(); //player1 = new GameSprite; // PlayerX.SetWorldX(0); // PlayerX.SetWorldY(0); // PlayerX.SetOrientation(0.0); //context.DrawTexture(context.GetBackground(),0 , 0); }