Opened 4 years ago

Last modified 4 years ago

#12126 new bug

A problem with lib GLEW

Reported by: Max-Might Owned by: kallisti5
Priority: normal Milestone: Unscheduled
Component: Kits/OpenGL Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


Hello. I am porting a program that uses lib glew to Haiku. I installed glew_x86 and glew_x86_util. The second package installs two executables - visualinfo_x86 and glewinfo_x86. They both fail to start - it seems like glewInit can not detect GL version?

~/stuff> visualinfo-x86 
Error [main]: glewInit failed: Missing GL version
~/stuff> glewinfo-x86 
Error [main]: glewInit failed: Missing GL version

I wonder if this is related to the mesa port or the problem is in libglew only. Looking at the libglew code it seems like glGetString(GL_VERSION) returns something that it does not recognize as a valid GL version. Can anyone help me investigate this issue?

Change History (3)

comment:1 Changed 4 years ago by kallisti5

Interesting... the GL_VERSION shouldn't of changed in any way to make it incompatible unless this version of glew is *really* old.

could you run the following?

pkgman search -D glew

The current recipe version is 1.12.0

comment:2 Changed 4 years ago by Max-Might

I had 1.11 installed, I just installed 1.12 from haikuports but the problem seems to persist.

I am using also the latest mesa_x86 with swpipe from haikuports:

~> pkgman search -D mesa
Repository  Name             Version   Arch    
<system>    mesa             7.9.2-10  x86_gcc2
HaikuPorts  mesa             7.9.2-10  x86_gcc2
<system>    mesa_devel       7.9.2-10  x86_gcc2
HaikuPorts  mesa_devel       7.9.2-10  x86_gcc2
HaikuPorts  mesa_source      7.9.2-10  source  
<system>    mesa_swrast      7.9.2-10  x86_gcc2
HaikuPorts  mesa_swrast      7.9.2-10  x86_gcc2
<system>    mesa_x86         10.5.2-1  x86_gcc2
HaikuPorts  mesa_x86         10.1.0-2  x86_gcc2
<system>    mesa_x86_devel   10.5.2-1  x86_gcc2
HaikuPorts  mesa_x86_devel   10.1.0-2  x86_gcc2
HaikuPorts  mesa_x86_source  10.1.0-2  source  
<system>    mesa_x86_swpipe  10.5.2-1  x86_gcc2
HaikuPorts  mesa_x86_swpipe  10.1.0-2  x86_gcc2
HaikuPorts  mesa_x86_swrast  10.1.0-2  x86_gcc2

I think the problem is not in glew but in glGetString(). #10206 also seems to be related to this problem. Do we have to implement something Haiku-specific in the swpipe driver for glGetString?

comment:3 Changed 4 years ago by Max-Might

So I ran the command again but this time with the mesa debug environment variable enabled.

~> MESA_DEBUG=1 glewinfo-x86 
GL User Error: calling GL function without a rendering context
Error [main]: glewInit failed: Missing GL version

Reading the HAiku patch in the ports tree is found that glewCreateContext returns GL_FALSE when it creates an instance of the application class. Do you think this causes the problem?

Edit: There is also a glewCreateContext stub at the bottom of src/glewinfo.c. I am not sure if the one in the Haiku patch is used at all.

Last edited 4 years ago by Max-Might (previous) (diff)
Note: See TracTickets for help on using tickets.