MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / startDraw

Method startDraw

Source/Graphics/graphics.cpp:421–439  ·  view source on GitHub ↗

Start the scene drawing by clearing and setting the matrixmode

Source from the content-addressed store, hash-verified

419
420// Start the scene drawing by clearing and setting the matrixmode
421void Graphics::startDraw(vec2 start, vec2 end, ScreenType screen_type) {
422 PROFILER_GPU_ZONE(g_profiler_ctx, "Graphics::startDraw()");
423 if (screen_type == kRender) {
424 setViewport((GLint)((float)render_dims[0] * start[0]),
425 (GLint)((float)render_dims[1] * start[1]),
426 (GLint)((float)render_dims[0] * end[0]),
427 (GLint)((float)render_dims[1] * end[1]));
428 } else if (screen_type == kWindow) {
429 setViewport((GLint)((float)window_dims[0] * start[0]),
430 (GLint)((float)window_dims[1] * start[1]),
431 (GLint)((float)window_dims[0] * end[0]),
432 (GLint)((float)window_dims[1] * end[1]));
433 } else if (screen_type == kTexture) {
434 setViewport((GLint)((float)start[0]),
435 (GLint)((float)start[1]),
436 (GLint)((float)end[0]),
437 (GLint)((float)end[1]));
438 }
439}
440
441void Graphics::TakeScreenshot() {
442 unsigned long width = window_dims[0];

Callers 4

SetViewportForCameraMethod · 0.80
DrawCubeMapMethod · 0.80
DrawMethod · 0.80
DrawImGuiCameraPreviewFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected