File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,17 @@ flag UseNativeWindowsLibraries
48
48
49
49
flag UseGlXGetProcAddress
50
50
description :
51
- Use glXGetProcAddress instead of dlsym on non-Windows/-Darwin platforms.
51
+ Use glXGetProcAddress instead of dlsym on non-Windows/-Darwin/-Android platforms.
52
+
53
+ flag UseGLES2
54
+ description :
55
+ Use OpenGL ES 2.x instead of OpenGL ES 3.x on Android.
56
+
57
+ flag OsAndroid
58
+ description :
59
+ Compile for Android. This flag goes away when cabal supports os(android).
60
+ default :
61
+ False
52
62
53
63
library
54
64
exposed-modules :
@@ -596,18 +606,25 @@ library
596
606
extra-libraries : opengl32
597
607
else
598
608
cpp-options : "-DCALLCONV=ccall"
599
- if !os(darwin) && !os(ios) && flag(UseGlXGetProcAddress)
600
- cc-options : "-DUSE_GLXGETPROCADDRESS"
601
- else
609
+ if os(darwin) || os(ios) || flag(OsAndroid) || !flag(UseGlXGetProcAddress)
610
+ -- TODO: Figure out if/when eglGetProcAddress should be used.
602
611
cc-options : "-DUSE_DLSYM"
612
+ else
613
+ cc-options : "-DUSE_GLXGETPROCADDRESS"
603
614
if os(darwin)
604
615
cpp-options : "-DHANDLE_IS_POINTER"
605
616
frameworks : OpenGL
606
617
else
607
618
if os(ios)
608
619
frameworks : OpenGLES
609
620
else
610
- extra-libraries : GL
621
+ if flag(OsAndroid)
622
+ if flag(UseGLES2)
623
+ extra-libraries : GLESv2
624
+ else
625
+ extra-libraries : GLESv3
626
+ else
627
+ extra-libraries : GL
611
628
612
629
source-repository head
613
630
type : git
You can’t perform that action at this time.
0 commit comments