3 #include "SDL_opengl.h"
8 void View::Translate(Real x, Real y)
16 static bool debug_output_done = false;
17 if (!debug_output_done)
19 m_document.DebugDumpObjects();
20 debug_output_done = true;
23 glClearColor(1.f,1.f,1.f,1.f);
24 glClear(GL_COLOR_BUFFER_BIT);
26 glMatrixMode(GL_PROJECTION);
28 glOrtho(Float(m_bounds.x), Float(m_bounds.x)+Float(m_bounds.w), Float(m_bounds.y) + Float(m_bounds.h), Float(m_bounds.y), -1.f, 1.f);
29 glMatrixMode(GL_MODELVIEW);
32 glColor4f(0.f,0.f,0.f,1.f);
34 for (unsigned id = 0; id < m_document.ObjectCount(); ++id)
36 if (m_document.m_objects.types[id] == RECT_FILLED)
38 Rect obj_bounds = m_document.m_objects.bounds[id];
39 glVertex2f(Float(obj_bounds.x), Float(obj_bounds.y));
40 glVertex2f(Float(obj_bounds.x) + Float(obj_bounds.w), Float(obj_bounds.y));
41 glVertex2f(Float(obj_bounds.x) + Float(obj_bounds.w), Float(obj_bounds.y) + Float(obj_bounds.h));
42 glVertex2f(Float(obj_bounds.x), Float(obj_bounds.y) + Float(obj_bounds.h));
46 for (unsigned id = 0; id < m_document.ObjectCount(); ++id)
48 if (m_document.m_objects.types[id] == RECT_OUTLINE)
50 Rect obj_bounds = m_document.m_objects.bounds[id];
51 glBegin(GL_LINE_LOOP);
52 glVertex2f(Float(obj_bounds.x), Float(obj_bounds.y));
53 glVertex2f(Float(obj_bounds.x) + Float(obj_bounds.w), Float(obj_bounds.y));
54 glVertex2f(Float(obj_bounds.x) + Float(obj_bounds.w), Float(obj_bounds.y) + Float(obj_bounds.h));
55 glVertex2f(Float(obj_bounds.x), Float(obj_bounds.y) + Float(obj_bounds.h));