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

OOGL doesn't play well with SDL2... #21

Open
BradWBeer opened this issue Jun 6, 2014 · 5 comments
Open

OOGL doesn't play well with SDL2... #21

BradWBeer opened this issue Jun 6, 2014 · 5 comments

Comments

@BradWBeer
Copy link

I'm trying to use SDL2 with OOGL and I've copied the relevant parts of the triangle sample. It gives a segmentation fault at the first call to create the vertex shader. This must have something to do with using SDL2 and not creating a window. Is there an example for using OOGL with other windowing libraries?

Thank you.

@1ace
Copy link

1ace commented Jun 6, 2014

segfaults are often caused by uninitialized variables; you should look at you code and make sure you initialized all your vars, including globals (with functions like SDL_GL_CreateContext(), which does a lot behind the scenes).
You might want to take a look at this for more explanations ;)

@BradWBeer
Copy link
Author

You are correct. I needed a call to a library which sets up the OpenGL function pointers. However when I use GL::LoadExtensions() I get 74 warnings:

Warning: type of symbol `glEndTransformFeedback' changed from 2 to 1 in /home/brad/work/external/OOGL/lib/OOGL.a(Extensions.o)

Using GLEW gives me conflicting definition errors for the function pointers. Is there a better way? I really like OOGL from what I've seen of it, and I would like to use it without heavily modifying it.

Finally, can I add a function to create a window object from a preexisting window? Then I can use the gl object proper.

Thanks!

@1ace
Copy link

1ace commented Jun 8, 2014

That error sounds like you need to recompile the object, but I can't help you with the rest: I'm a complete noob with OpenGL, and I haven't used OOGL yet.
Good luck!

@vprimachenko
Copy link

type of symbol ... changed from X to Y erros indicate you have same function defines two times, most probably its a conflict of SDL_gl.h and OOGL. As to creating an OOGL::Window object from existing SDL_Window, you would need to obtain the real window decriptor from SDL2 (look into SDL_syswm.h for that) and roll your own Window constructor like that one in OOGL/src/GL/Window/Window_X11.cpp

@BradWBeer
Copy link
Author

I could not get SDL2 to play nicely with OOGL's window class. I've hacked out the windowing and platform specific code as well as the extensions code in favor of glew. I'm not sure if anyone wants this, but I'm willing to share.

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

3 participants