Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

Examples runtime problem - OpenGL / GLX related #95

Closed
smartmic opened this issue Apr 20, 2016 · 10 comments
Closed

Examples runtime problem - OpenGL / GLX related #95

smartmic opened this issue Apr 20, 2016 · 10 comments

Comments

@smartmic
Copy link

I have a Debian Wheezy box and had already to change the linking lib to get compilation done. Compilation finishes without errors now, but I could not get the examples running, this is the error:

$ bin/overview
Error 65543: GLX: An OpenGL profile requested but GLX_ARB_create_context_profile is unavailable
Speicherzugriffsfehler

My LIBS variable in the Makefile was determined with pkg-config:

$ pkg-config --static --libs glfw3 gl glew glu
-L/usr/local/lib -lglfw3 -lrt -ldl -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -lXrender -lXfixes -lGLEW -lGLU -lGL -lm -lXext -lX11 -lpthread -lxcb -lXau -lXdmcp

I was wondering if the runtime is related to missing dependencies, but the mentioned profile is availble, see my output of glxinfo. What am I missing? Or is nouveau the culprit?

$ glxinfo
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_OML_swap_method, GLX_SGI_swap_control, GLX_SGIS_multisample,
    GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,
    GLX_INTEL_swap_event
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile,
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_framebuffer_sRGB,
    GLX_EXT_create_context_es2_profile, GLX_MESA_copy_sub_buffer,
    GLX_MESA_multithread_makecurrent, GLX_MESA_swap_control,
    GLX_OML_swap_method, GLX_OML_sync_control, GLX_SGI_make_current_read,
    GLX_SGI_swap_control, GLX_SGI_video_sync, GLX_SGIS_multisample,
    GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,
    GLX_EXT_texture_from_pixmap, GLX_INTEL_swap_event
GLX version: 1.4
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_MESA_multithread_makecurrent, GLX_MESA_swap_control,
    GLX_OML_swap_method, GLX_OML_sync_control, GLX_SGI_make_current_read,
    GLX_SGI_swap_control, GLX_SGI_video_sync, GLX_SGIS_multisample,
    GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,
    GLX_EXT_texture_from_pixmap
OpenGL vendor string: nouveau
OpenGL renderer string: Gallium 0.4 on NVAC
OpenGL version string: 2.1 Mesa 8.0.5
OpenGL shading language version string: 1.20
OpenGL extensions:
@pendingchaos
Copy link

Updating to a newer version of Mesa might fix this problem. The overview example requires OpenGL 3.3 support. The output of glxinfo shows OpenGL 2.1 support.

@dumblob
Copy link
Contributor

dumblob commented Apr 20, 2016

Seems to be similar to #89 - @smartmic take a look at the proposed solution outlined in #89 (comment) .

@vurtun
Copy link
Owner

vurtun commented Apr 21, 2016

Thanks for you issue. Quick question does any of the demos work or is nothing running at all? If none of the demos or examples run then like @dumblob there is the possibility that you don't have the correct OpenGL version. If it is really a version problem then I probably have to create a OpenGL demo version which runs on a lower version.

@smartmic
Copy link
Author

Thanks for the answers. The only demo I could get run was x11/bin/zahnrad. For all of the examples the error remains also when following the proposed solution in #89. So I guess it is due to my older OpenGL version. Is there a simple trick to use nuklear with older OpenGL versions as well?

@vurtun
Copy link
Owner

vurtun commented Apr 21, 2016

I can spend some time tomorrow and see how far I get with an older version of OpenGL for glfw and sdl.

@andreygursky
Copy link
Contributor

OpenGL 2.1 support

@smartmic:
you can start with the following patch:

diff --git a/example/overview.c b/example/overview.c
index 2b7126b..7a71ddb 100644
--- a/example/overview.c
+++ b/example/overview.c
@@ -1381,9 +1381,8 @@ int main(int argc, char *argv[])
         fprintf(stdout, "[GFLW] failed to init!\n");
         exit(1);
     }
-    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
-    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
-    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
+    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
+    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
 #ifdef __APPLE__
     glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
 #endif

@andreygursky
Copy link
Contributor

And then probably continue with: #89 (comment)

@daumiller
Copy link

daumiller commented Apr 25, 2016

Here's another, working, starting point. https://gist.github.com/daumiller/9301246b24b3efe5b26006d88856747f

It needs cleaning up; but it does work.
(Things could be changed/re-arranged, and a lot of the state code was ripped out.)

@smartmic
Copy link
Author

@andreygursky thanks, first step was successful, but I still could not get it run. The suggestion of #89 did not help, and I still get this error:

$ bin/overview
overview: overview.c:1193: void device_init(struct device *): Assertion `status == 1' failed.
Abgebrochen

How can I find out if my system / vintage graphics card fulfills all prerequisites?

@vurtun
Copy link
Owner

vurtun commented Apr 29, 2016

OK I finished a OpenGL 2 demo version for SDL and GLFW (389176e) which allows using this library for older device with older OpenGL versions.

@vurtun vurtun closed this as completed Apr 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants