Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build with OpenGL 3.0 #109

Open
bfops opened this issue Apr 22, 2015 · 7 comments
Open

Fails to build with OpenGL 3.0 #109

bfops opened this issue Apr 22, 2015 · 7 comments
Assignees

Comments

@bfops
Copy link
Contributor

bfops commented Apr 22, 2015

[ 11%] Building CXX object source/lib/oglplus/CMakeFiles/oglplus.dir/text.cpp.o
In file included from /home/ben/devl/oglplus/source/lib/oglplus/text.cpp:33:0:
/home/ben/devl/oglplus/include/oglplus/text/bitmap_glyph.hpp:17:2: error: #error "The Bitmap glyph text rendering utility requires GL version 3.1"
 #error "The Bitmap glyph text rendering utility requires GL version 3.1"
  ^
In file included from /home/ben/devl/oglplus/source/lib/oglplus/text.cpp:34:0:
/home/ben/devl/oglplus/include/oglplus/text/stb_truetype.hpp:17:2: error: #error "The STB TrueType text rendering utility requires GL version 3.1"
 #error "The STB TrueType text rendering utility requires GL version 3.1"
  ^
In file included from /home/ben/devl/oglplus/include/oglplus/text/bitmap_glyph/pager.hpp:145:0,
                 from /home/ben/devl/oglplus/include/oglplus/text/bitmap_glyph/font_essence.hpp:19,
                 from /home/ben/devl/oglplus/include/oglplus/text/bitmap_glyph.hpp:22,
                 from /home/ben/devl/oglplus/source/lib/oglplus/text.cpp:33:
/home/ben/devl/oglplus/implement/oglplus/text/bitmap_glyph/pager.ipp: In constructor ‘oglplus::text::BitmapGlyphPager::BitmapGlyphPager(oglplus::text::BitmapGlyphRenderingBase&, oglplus::TextureUnitSelector, GLsizei)’:
/home/ben/devl/oglplus/implement/oglplus/text/bitmap_glyph/pager.ipp:98:2: error: ‘Buffer’ is not a member of ‘oglplus::Texture {aka oglplus::Object<oglplus::ObjectOps<oglplus::tag::ExplicitSel, oglplus::tag::Texture> >}’
  Texture::Buffer(
  ^
source/lib/oglplus/CMakeFiles/oglplus.dir/build.make:376: recipe for target 'source/lib/oglplus/CMakeFiles/oglplus.dir/text.cpp.o' failed
make[2]: *** [source/lib/oglplus/CMakeFiles/oglplus.dir/text.cpp.o] Error 1
CMakeFiles/Makefile2:5000: recipe for target 'source/lib/oglplus/CMakeFiles/oglplus.dir/all' failed
make[1]: *** [source/lib/oglplus/CMakeFiles/oglplus.dir/all] Error 2
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2

This seems intentional - should the configure script just fail if it can't find OpenGL > 3.0, or should this component just be disabled?

@bfops
Copy link
Contributor Author

bfops commented Apr 22, 2015

Ah, I notice I have OpenGL version string: 3.0 Mesa 10.3.2 as well as OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.3.2 installed; does oglplus rely on non-core features?

@matus-chochlik matus-chochlik self-assigned this Apr 23, 2015
@bfops
Copy link
Contributor Author

bfops commented Apr 23, 2015

Oops, I was building the develop branch. The build succeeds for me on master, but the examples seem to be using the non-core OpenGL. I'm getting a lot of errors like:

Program build error
Source file: '/home/ben/devl/oglplus/implement/oglplus/shader.ipp'
Source line: 50
Source function: 'Compile'
Message: 'OpenGL shading language compilation error'
GL constant: 'VERTEX_SHADER'
Object type: 'SHADER'
Object: (1)
Log:
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

001_triangle: /home/ben/devl/oglplus/example/oglplus/glut_main.cpp:117: static void oglplus::SingleExample::CloseFunc(): Assertion `SingleInstance()' failed.
Aborted

@bfops
Copy link
Contributor Author

bfops commented Apr 24, 2015

The master build only succeeds because ./configure.sh infers GL_VERSION_3_3; it still fails if I pass --max-gl-version 3_1 or lower. When the build succeeds with 3_2 or 3_3, I get those errors from the examples.

@bfops
Copy link
Contributor Author

bfops commented Apr 24, 2015

The cloud_trace example fails because this operator is only defined in 3_2 and above in include/oglplus/framebuffer.hpp:

inline FramebufferTarget operator << (
    FramebufferTargetAndAttch taa,
    TextureName tex
)

Removing that example makes the build succeed with 3_1 for me.

@matus-chochlik
Copy link
Owner

Hi,

yeah, most of the examples use GLSL 3.30 or higher, there are however some using GLSL 1.40. And (un)fortunately most of my machines support at least GL version 3.3. I'll have to install Mesa somewhere and test it with that.

@bfops
Copy link
Contributor Author

bfops commented Apr 24, 2015

I'm noticing that quite a few of the examples are labeled OpenGL 3.0 and still use GLSL 330; downgrading to #version 130 makes them run fine.

Also, quite a few examples are labeled GL_VERSION_3_0 but use geometry shaders, which need GL_VERSION_3_2.

If you don't feel like doing all that fiddling, I can work on a PR to fix the GL_VERSION_3_0 examples to either work with OpenGL 3.0 or to have a higher version constraint.

I'm also a little confused because my machine does support OpenGL 3.3 (GLSL 330) core profile, but the binaries don't seem to realize they have that option. It's probably an environment issue on my end, but I don't really know how to go about diagnosing it..

Unfortunately, I'm still at a loss for getting the build to pass with --max-gl-version 3_0, even without the cloud_trace example built in.

@bfops
Copy link
Contributor Author

bfops commented Apr 24, 2015

Oh, the configure script does mention that the build will fail with OpenGL 3.0. I feel like it should be possible to get a successful build with 3.0 and 3.1 though.

I actually did manage to get the examples to use the core profile instead of compatibility, just by adding glutInitContextVersion (3, 3); to glut_main.cpp, and all the ones I tried worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants