Hi, I was wondering if It's possible to make SFML and SFGUI use
OpenGL Loader Generator instead of SFML with
Glew and SFGUI with
GLee. My final executable size has a limit of 3 max 4 MB (UPX compressed) and those two add up about >1 MB which doesn't leave room for my other libraries. Also it's pointless to have two commonly combined projects that each use a library that does the same thing as the other. While
OpenGL Loader Generator (
from what I've read) is better and (
from what I've seen) is smaller (
about ~100 Kb).
I'm asking this because right now I'm not that much of an expert in OpenGL or know too much of SFML and SFGUI internal code design. So before I start changing code I wan't to know if it's possible, that way I won't hit my head to the wall only to find out it's not possible (
or recommended).
I used Notedpad++ to run a global search in the source files of SFML and SFGUI and from what I've seen they both use
Glew and
GLee only to check if some OpenGL extensions are available. I'm guessing that all I have to do is adapt the code to use
OpenGL Loader Generator instead.
SFML uses Glew in:
D:\DevLibs\SFML-master\src\SFML\Graphics\GLCheck.cpp (5 hits)
Line 111: void ensureGlewInit()
Line 116: GLenum status = glewInit();
Line 117: if (status == GLEW_OK)
Line 123: err() << "Failed to initialize GLEW, " << glewGetErrorString(status) << std::endl;
Line 123: err() << "Failed to initialize GLEW, " << glewGetErrorString(status) << std::endl;
D:\DevLibs\SFML-master\src\SFML\Graphics\GLCheck.hpp (3 hits)
Line 32: #include <GL/glew.h>
Line 65: /// \brief Make sure that GLEW is initialized
Line 68: void ensureGlewInit();
D:\DevLibs\SFML-master\src\SFML\Graphics\RenderTarget.cpp (4 hits)
Line 293: // Make sure that GLEW is initialized
Line 294: priv::ensureGlewInit();
Line 366: if (GLEW_EXT_blend_func_separate)
Line 374: if (GLEW_EXT_blend_func_separate)
D:\DevLibs\SFML-master\src\SFML\Graphics\RenderTextureImplFBO.cpp (3 hits)
Line 76: // Make sure that GLEW is initialized
Line 77: priv::ensureGlewInit();
Line 79: return GLEW_EXT_framebuffer_object != 0;
D:\DevLibs\SFML-master\src\SFML\Graphics\Shader.cpp (6 hits)
Line 430: // Make sure that GLEW is initialized
Line 431: priv::ensureGlewInit();
Line 433: return GLEW_ARB_shading_language_100 &&
Line 434: GLEW_ARB_shader_objects &&
Line 435: GLEW_ARB_vertex_shader &&
Line 436: GLEW_ARB_fragment_shader;
D:\DevLibs\SFML-master\src\SFML\Graphics\Texture.cpp (3 hits)
Line 533: // Make sure that GLEW is initialized
Line 534: priv::ensureGlewInit();
Line 536: if (GLEW_ARB_texture_non_power_of_two)
SFGUI uses GLee in:
D:\DevLibs\SFGUI\src\SFGUI\Renderers\VertexBufferRenderer.cpp (8 hits)
Line 1: // Needs to be included before GLee for NOMINMAX
Line 5: #include <GLee.h>
Line 30: // with GLee or else it will report missing extensions sometimes.
Line 33: if( GLEE_ARB_vertex_buffer_object ) {
Line 47: if( GLEE_EXT_framebuffer_object || GLEE_ARB_framebuffer_object ) {
Line 47: if( GLEE_EXT_framebuffer_object || GLEE_ARB_framebuffer_object ) {
Line 70: // with GLee or else it will report missing extensions sometimes.
Line 73: if( GLEE_ARB_vertex_buffer_object ) {
So yeah, is it possible or not? I'm waiting for your replies
More about OpenGL Loader Generator:
Performance advantages using OpenGL Loader Generator over GLEW?