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

[rlgl] Compile issue with GL_HALF_FLOAT_OES on GRAPHICS_API_OPENGL_21 #3226

Closed
4 tasks done
ghost opened this issue Aug 6, 2023 · 6 comments · Fixed by #3233
Closed
4 tasks done

[rlgl] Compile issue with GL_HALF_FLOAT_OES on GRAPHICS_API_OPENGL_21 #3226

ghost opened this issue Aug 6, 2023 · 6 comments · Fixed by #3233

Comments

@ghost
Copy link

ghost commented Aug 6, 2023

  • I tested it on latest raylib version from master branch
  • I checked there is no similar issue already reported
  • I checked the documentation on the wiki
  • My code has no errors or misuse of raylib

Issue description

While trying to compile the lastest master branch (b82217e) for PLATFORM_DESKTOP with GRAPHICS_API_OPENGL_21 on Linux I get this error:

~/test$ unzip raylib-master.zip
[...]
~/test$ cd raylib-master/src/
~/test/raylib-master/src$ make PLATFORM=PLATFORM_DESKTOP GRAPHICS=GRAPHICS_API_OPENGL_21
gcc -c rcore.c -Wall -D_GNU_SOURCE -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_21 -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing  -std=c99 -fPIC -O1 -Werror=implicit-function-declaration -I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw
In file included from rcore.c:121:
rlgl.h: In function ‘rlGetGlTextureFormats’:
rlgl.h:3270:151: error: ‘GL_HALF_FLOAT_OES’ undeclared (first use in this function); did you mean ‘GL_HALF_FLOAT_ARB’?
 3270 |  RL_PIXELFORMAT_UNCOMPRESSED_R16: if (RLGL.ExtSupported.texFloat16) *glInternalFormat = GL_LUMINANCE; *glFormat = GL_LUMINANCE; *glType = GL_HALF_FLOAT_OES; break;   // NOTE: Requires extension OES_texture_half_float
      |                                                                                                                                           ^~~~~~~~~~~~~~~~~
      |                                                                                                                                           GL_HALF_FLOAT_ARB
rlgl.h:3270:151: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Makefile:687: rcore.o] Error 1

The error doesn't happen if I use GRAPHICS_API_OPENGL_11 or GRAPHICS_API_OPENGL_33.

I believe this is related to a previous commit: dc621ca.

@Not-Nik I'm unfamiliar with GL_HALF_FLOAT_OES. If you can, could you please take a look at this?

Environment

Platform: Desktop
Operating System: Linux Mint 21.1 (x86_64)
OpenGL version: 3.1 Mesa 22.0.5
GPU: Intel HD Graphics 3000

@Not-Nik
Copy link
Contributor

Not-Nik commented Aug 6, 2023

I'll look into it once I get home from work

@ghost
Copy link
Author

ghost commented Aug 6, 2023

Thank you very much!

@raysan5
Copy link
Owner

raysan5 commented Aug 6, 2023

Please note that GRAPHICS_API_OPENGL_21 defines by default GRAPHICS_API_OPENGL_33 for convenience, probably the issue relies there.

@Not-Nik
Copy link
Contributor

Not-Nik commented Aug 6, 2023

No it doesn't, we just aren't differentiating between OpenGL 2.1 and ES 2 so I'll add another ifdef branch for that

@Not-Nik
Copy link
Contributor

Not-Nik commented Aug 8, 2023

Opened a PR. I also suggest we add a CI check for GL 2.1 builds so this doesn't happen again

@ghost
Copy link
Author

ghost commented Aug 8, 2023

@Not-Nik Thank you very much for the fix!

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

Successfully merging a pull request may close this issue.

2 participants