MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / activate

Method activate

engine/source/platformAndroid/AndroidOGLVideo.cpp:122–142  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Activate this is called once, as a result of createCanvas() in scripts. dumps OpenGL driver info for the current screen creates an initial window via setScreenMode

Source from the content-addressed store, hash-verified

120// dumps OpenGL driver info for the current screen
121// creates an initial window via setScreenMode
122bool OpenGLDevice::activate(U32 width, U32 height, U32 bpp, bool fullScreen)
123{
124 Con::printf(" OpenGLDevice activating...");
125
126 // gets opengl rendering capabilities of the screen pointed to by platState.hDisplay
127 // sets up dgl with the capabilities info, & reports opengl status.
128
129 getGLCapabilities();
130
131 // Create the window or capture fullscreen
132 if (!setScreenMode(width, height, bpp, fullScreen, true, false))
133 return false;
134
135 // set the displayDevice pref to "OpenGL"
136 Con::setVariable("$pref::Video::displayDevice", mDeviceName);
137
138 // set vertical sync now because it doesnt need setting every time we setScreenMode()
139 setVerticalSync(!Con::getBoolVariable("$pref::Video::disableVerticalSync"));
140
141 return true;
142}
143
144//------------------------------------------------------------------------------
145// returns TRUE if textures need resurrecting in future...

Callers

nothing calls this directly

Calls 4

printfFunction · 0.85
setVariableFunction · 0.85
getBoolVariableFunction · 0.85
getGLCapabilitiesFunction · 0.70

Tested by

no test coverage detected