45 { GL_OUT_OF_MEMORY, "Out of memory" }, |
45 { GL_OUT_OF_MEMORY, "Out of memory" }, |
46 { GL_STACK_UNDERFLOW, "The operation would have caused an underflow" }, |
46 { GL_STACK_UNDERFLOW, "The operation would have caused an underflow" }, |
47 { GL_STACK_OVERFLOW, "The operation would have caused an overflow" }, |
47 { GL_STACK_OVERFLOW, "The operation would have caused an overflow" }, |
48 }; |
48 }; |
49 |
49 |
50 #include <QTime> |
|
51 #include <QFile> |
|
52 |
|
53 #define CLOCK_INIT QTime t0; |
|
54 |
|
55 #define CLOCK_START \ |
|
56 { \ |
|
57 t0 = QTime::currentTime(); \ |
|
58 } |
|
59 |
|
60 #define CLOCK_TIME(A) \ |
|
61 { \ |
|
62 fprint (stderr, A ": %1ms\n", t0.msecsTo (QTime::currentTime())); \ |
|
63 } |
|
64 |
|
65 #define DEBUG_PRINT(...) fprint (stdout, __VA_ARGS__) |
|
66 |
|
67 extern_cfg (Bool, gl_blackedges); |
50 extern_cfg (Bool, gl_blackedges); |
68 extern_cfg (String, gl_bgcolor); |
51 extern_cfg (String, gl_bgcolor); |
69 static QList<short> g_warnedColors; |
52 static QList<short> g_warnedColors; |
70 static const QColor g_BFCFrontColor (40, 192, 40); |
53 static const QColor g_BFCFrontColor (40, 192, 40); |
71 static const QColor g_BFCBackColor (224, 40, 40); |
54 static const QColor g_BFCBackColor (224, 40, 40); |
240 void GLCompiler::prepareVBO (int vbonum) |
223 void GLCompiler::prepareVBO (int vbonum) |
241 { |
224 { |
242 // Compile anything that still awaits it |
225 // Compile anything that still awaits it |
243 compileStaged(); |
226 compileStaged(); |
244 |
227 |
245 if (m_vboChanged[vbonum] == false) |
228 if (not m_vboChanged[vbonum]) |
246 return; |
229 return; |
247 |
230 |
248 QVector<GLfloat> vbodata; |
231 QVector<GLfloat> vbodata; |
249 |
|
250 /* |
|
251 if (vbonum == vboNumber (VBOSF_Triangles, VBOCM_Surfaces)) |
|
252 { |
|
253 QFile f ("vbo.log"); |
|
254 if (f.open (QIODevice::WriteOnly)) |
|
255 { |
|
256 for (auto it = m_objectInfo.begin(); it != m_objectInfo.end(); ++it) |
|
257 { |
|
258 if (it.key()->document() == getCurrentDocument()) |
|
259 { |
|
260 fprint (f, "----- #%1 (%2:%3)\n", it.key()->id(), |
|
261 it.key()->document()->getDisplayName(), it.key()->lineNumber()); |
|
262 const QVector<GLfloat>& v = it.value().data[vbonum]; |
|
263 |
|
264 for (int i = 0; i < v.size() / 3; ++i) |
|
265 fprint (f, "- %1, %2, %3\n", v[i * 3], v[1 * 3 + 1], v[1 * 3 + 2]); |
|
266 } |
|
267 } |
|
268 |
|
269 f.close(); |
|
270 } |
|
271 } |
|
272 */ |
|
273 |
232 |
274 for (auto it = m_objectInfo.begin(); it != m_objectInfo.end(); ++it) |
233 for (auto it = m_objectInfo.begin(); it != m_objectInfo.end(); ++it) |
275 { |
234 { |
276 if (it.key()->document() == getCurrentDocument() && it.key()->isHidden() == false) |
235 if (it.key()->document() == getCurrentDocument() && it.key()->isHidden() == false) |
277 vbodata += it->data[vbonum]; |
236 vbodata += it->data[vbonum]; |