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

Segmentation Error When Using Glad #1988

Closed
FatKatOriginal opened this issue Jul 30, 2018 · 3 comments
Closed

Segmentation Error When Using Glad #1988

FatKatOriginal opened this issue Jul 30, 2018 · 3 comments

Comments

@FatKatOriginal
Copy link

Segmentation Error When Using Glad But Not GL3W on Ubuntu With Codeblocks, Does not happen for older ImGui I Think 1.51 or so. Dont really need solved if I need to use newer ImGui and just switch to unlicensed GL3W instead of GLAD but not sure what the issue is.

@ocornut
Copy link
Owner

ocornut commented Jul 30, 2018

Please provide more details. None of the code provided under the examples/ folder uses Glad so the information is in your camp to provide, and I don’t understand half of your message.

If you say there is a crash please provide a callstack. Most likely you aren’t using/initializaing Glad properly and this isn’t an imgui example issue.

@ocornut ocornut changed the title Segmentation Error When Using Glad But Not GL3W on Ubuntu With Codeblocks, Does not happen for older ImGui I Think 1.51 or so Segmentation Error When Using Glad Jul 30, 2018
@FatKatOriginal
Copy link
Author

Dude thanks so much for ImGui and the fast reply!!!

I'm still learning programming. Not completely sure what the call stack thing is. The error codeblocks shows is something segementation error 139 and then some pointer address I think, not sure if that is what you mean by call stack. (All I am doing when testing is taking the example code Opengl/GLFW, and uncommenting glad and commenting GL3W, and then changing gl3wInit to glfwInit--so perhaps there are other things that work with my older version of ImGui with Glad that I would find if I analyze the differences more.

The custom non example code I have been testing I created with ImGui like a year ago with GLAD and am continuing development. I have been trying to get the new version of ImGui example code running in a blank project for a few weeks now. Today I finally tried with GL3W, instead of GLAD and it's working fine with that.

I prefer The Unlicense to MIT so will probably just switch to GL3W if and when I need to use a newer version of ImGUI. I can try to test it out and figure it out more if you want, But this is a minor issue and I will probably figure it out on my own. Just figured I'd mention that a quasi fixed my problem by just using GL3W instead of GLAD.

Omar any chance you would ever consider changing the ImGui license to "The Unlicense"?

Thanks again for everything!!

@ocornut
Copy link
Owner

ocornut commented Jul 31, 2018

A call-stack is the list of nested function calls (along with corresponding source code line) that led to the crash, which helps understand the cause of the crash. When you compile with debug information and use a debugger this is what the debugger should give you when you get a crash.

and then changing gl3wInit to glfwInit

You mean gladLoadGL() ? that's the initialization function for glad. glfwInit() is for GLFW which handle windowing and inputs. Glad and Gl3w only "load" OpenGL functions. If you don't load them (which is done at the time of initialization, here probably gladLoadGL) it is probable that the function pointers will be NULL and lead to a crash when called.
If you are using Glad please check out its documentation and examples.

No plan to change the license at the moment.

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

No branches or pull requests

2 participants