3 #include "SDL_opengl.h"
10 static bool debug_output_done = false;
11 if (!debug_output_done)
13 m_document.DebugDumpObjects();
14 debug_output_done = true;
17 glClearColor(1.f,1.f,1.f,1.f);
18 glClear(GL_COLOR_BUFFER_BIT);
20 glMatrixMode(GL_PROJECTION);
22 glOrtho(m_bounds.x, m_bounds.x+m_bounds.w, m_bounds.y + m_bounds.h, m_bounds.y, -1.f, 1.f);
23 glMatrixMode(GL_MODELVIEW);
26 glColor4f(0.f,0.f,0.f,1.f);
28 for (unsigned id = 0; id < m_document.ObjectCount(); ++id)
30 if (m_document.m_objects.types[id] == RECT_FILLED)
32 Rect obj_bounds = m_document.m_objects.bounds[id];
33 glVertex2f(obj_bounds.x, obj_bounds.y);
34 glVertex2f(obj_bounds.x + obj_bounds.w, obj_bounds.y);
35 glVertex2f(obj_bounds.x + obj_bounds.w, obj_bounds.y + obj_bounds.h);
36 glVertex2f(obj_bounds.x, obj_bounds.y + obj_bounds.h);
40 for (unsigned id = 0; id < m_document.ObjectCount(); ++id)
42 if (m_document.m_objects.types[id] == RECT_OUTLINE)
44 Rect obj_bounds = m_document.m_objects.bounds[id];
45 glBegin(GL_LINE_LOOP);
46 glVertex2f(obj_bounds.x, obj_bounds.y);
47 glVertex2f(obj_bounds.x + obj_bounds.w, obj_bounds.y);
48 glVertex2f(obj_bounds.x + obj_bounds.w, obj_bounds.y + obj_bounds.h);
49 glVertex2f(obj_bounds.x, obj_bounds.y + obj_bounds.h);