MCPcopy Create free account
hub / github.com/defold/defold / Execute

Method Execute

engine/graphics/src/test/test_app_graphics.cpp:249–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247 }
248
249 void Execute(EngineCtx* engine) override
250 {
251 static uint8_t color_r = 0;
252 static uint8_t color_g = 80;
253 static uint8_t color_b = 140;
254 static uint8_t color_a = 255;
255
256 dmGraphics::Clear(engine->m_GraphicsContext, dmGraphics::BUFFER_TYPE_COLOR0_BIT,
257 (float) color_r,
258 (float) color_g,
259 (float) color_b,
260 (float) color_a,
261 1.0f, 0);
262
263 uint32_t w = dmGraphics::GetWindowWidth(engine->m_GraphicsContext);
264 uint32_t h = dmGraphics::GetWindowHeight(engine->m_GraphicsContext);
265
266 dmGraphics::SetViewport(engine->m_GraphicsContext, 0, 0, w, h);
267
268 dmGraphics::EnableProgram(engine->m_GraphicsContext, m_Program);
269 dmGraphics::EnableVertexBuffer(engine->m_GraphicsContext, m_VertexBuffer, 0);
270 dmGraphics::EnableVertexDeclaration(engine->m_GraphicsContext, m_VertexDeclaration, 0, 0, m_Program);
271
272 // TODO: Bind resources here
273
274 dmGraphics::Draw(engine->m_GraphicsContext, dmGraphics::PRIMITIVE_TRIANGLES, 0, 6, 1);
275 }
276};
277
278struct ReadPixelsTest : ITest

Callers

nothing calls this directly

Calls 8

ClearFunction · 0.85
SetViewportFunction · 0.85
EnableProgramFunction · 0.85
EnableVertexBufferFunction · 0.85
GetWindowWidthFunction · 0.50
GetWindowHeightFunction · 0.50
EnableVertexDeclarationFunction · 0.50
DrawFunction · 0.50

Tested by

no test coverage detected