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

Method Draw

Source/Graphics/Cursor.cpp:33–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31#include <Main/engine.h>
32
33void GameCursor::Draw() {
34 if (Graphics::Instance()->media_mode()) {
35 UIShowCursor(true);
36 return;
37 }
38
39 if (!visible || !m_texture_ref.valid()) return;
40
41 CHECK_GL_ERROR();
42 int* mouse_pos = Input::Instance()->getMouse().pos_;
43 int* window_dims = Graphics::Instance()->window_dims;
44 vec3 draw_pos(
45 (float)(mouse_pos[0] + m_offset_x),
46 (float)((window_dims[1] - mouse_pos[1]) - m_offset_y),
47 0.0f);
48 Textures::Instance()->drawTexture(m_texture_ref, draw_pos,
49 m_size, m_rotation);
50 CHECK_GL_ERROR();
51}
52
53void GameCursor::SetCursor(_cursor_type t) {
54 // std::pair<int, int> dimensions;

Callers

nothing calls this directly

Calls 4

UIShowCursorFunction · 0.85
media_modeMethod · 0.80
drawTextureMethod · 0.80
validMethod · 0.45

Tested by

no test coverage detected