34 #if defined(WIN32) && defined(DIRECTX)
35 #include "dx/painterdx9.h"
48 m_maxTextureSize = -1;
57 #if defined(WIN32) && defined(DIRECTX)
58 g_painterDX9 =
new PainterDX9;
67 GLenum err = glewInit();
72 if(GLEW_EXT_framebuffer_object && !GLEW_ARB_framebuffer_object) {
73 glGenFramebuffers = glGenFramebuffersEXT;
74 glDeleteFramebuffers = glDeleteFramebuffersEXT;
75 glBindFramebuffer = glBindFramebufferEXT;
76 glFramebufferTexture2D = glFramebufferTexture2DEXT;
77 glCheckFramebufferStatus = glCheckFramebufferStatusEXT;
78 glGenerateMipmap = glGenerateMipmapEXT;
93 int maxTextureSize = 0;
94 glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
95 if(m_maxTextureSize == -1 || m_maxTextureSize > maxTextureSize)
96 m_maxTextureSize = maxTextureSize;
99 m_cacheBackbuffer =
false;
102 glGetIntegerv(GL_ALPHA_BITS, &m_alphaBits);
139 if(option ==
"-no-draw-arrays")
140 m_useDrawArrays =
false;
141 else if(option ==
"-no-fbos")
143 else if(option ==
"-no-mipmaps")
144 m_useMipmaps =
false;
145 else if(option ==
"-no-hardware-mipmaps")
146 m_useHardwareMipmaps =
false;
147 else if(option ==
"-no-smooth")
148 m_useBilinearFiltering =
false;
149 else if(option ==
"-hardware-buffers")
150 m_useHardwareBuffers =
true;
151 else if(option ==
"-no-non-power-of-two-textures")
152 m_useNonPowerOfTwoTextures =
false;
153 else if(option ==
"-no-clamp-to-edge")
154 m_useClampToEdge =
false;
155 else if(option ==
"-no-backbuffer-cache")
156 m_cacheBackbuffer =
false;
157 else if(option ==
"-opengl1")
159 else if(option ==
"-opengl2")
168 #if defined(WIN32) && defined(DIRECTX)
188 Painter *fallbackPainter =
nullptr;
199 painter = g_painterDX9;
201 fallbackPainter = g_painterDX9;
231 painter = fallbackPainter;
232 m_selectedPainterEngine = fallbackPainterEngine;
247 g_logger.
fatal(
"Neither OpenGL 1.0 nor OpenGL 2.0 painter engine is supported by your platform, "
248 "try updating your graphics drivers or your hardware and then run again.");
250 return m_selectedPainterEngine == painterEngine;
255 m_viewportSize = size;
273 if(!GLEW_VERSION_1_1)
275 return m_useDrawArrays;
287 if(GLEW_ARB_vertex_program && GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader)
302 if(!GLEW_ARB_framebuffer_object || !GLEW_EXT_framebuffer_object)
311 return m_useBilinearFiltering;
317 return m_useHardwareBuffers;
323 if(!GLEW_ARB_vertex_buffer_object)
326 return m_useHardwareBuffers;
332 return m_useNonPowerOfTwoTextures;
337 if(!GLEW_ARB_texture_non_power_of_two)
339 return m_useNonPowerOfTwoTextures;
352 return m_useHardwareMipmaps;
357 if(!GLEW_ARB_framebuffer_object || !GLEW_EXT_framebuffer_object)
359 return m_useHardwareMipmaps;
366 return m_useClampToEdge;
369 if(!GLEW_VERSION_1_2)
371 return m_useClampToEdge;
382 if(!GLEW_VERSION_1_4)
395 if(!GLEW_VERSION_1_4)
406 return m_cacheBackbuffer;
410 if(!GLEW_VERSION_1_4)
412 return m_cacheBackbuffer;
423 if(!GLEW_VERSION_1_2)