Comments (11)
Ideally we'd simply skip glu.h
for Swift, as we already do for iOS...
Any suggestions for some preprocessor logic?
#ifndef GLEW_NO_GLU
# ifdef __APPLE__
# include <Availability.h>
# if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
# define GLEW_NO_GLU
# endif
# endif
#endif
#ifndef GLEW_NO_GLU
/* this is where we can safely include GLU */
# if defined(__APPLE__) && defined(__MACH__)
# include <OpenGL/glu.h>
# else
# include <GL/glu.h>
# endif
#endif
from glew.
I'd recommend using -DGLEW_NO_GLU for Swift, for sure.
from glew.
It's not just Swift. It's anything using clang modules on Apple. So everything Xcode too. It probably never came up before since you just "import OpenGL" in Xcode so why bother with GLEW. Which is the answer on Q&A sites.
You can't -D with the open source Swift right now. Really. The Swift package manager is very anemic. I do have GLEW working with glu and I'm hoping new Swift features will let me do something less fragile in the future. But maybe we can fix it up for everyone using modules in other languages too.
The issue is I don't know why glu is loaded so early. I assume for some platform I'm not familiar with. If that's not the case, glu can be moved to the very end of GLEW.h so it's painless everywhere. Or maybe just for Apple it's at the end. Doing Apple at the end works in my tests.
If you don't see a problem with doing Apple at the end, I can send a patch. I can also move all glu to the end. Probably easier to maintain all glu in one place. But not if it blows up some other platform.
from glew.
GLEW itself doesn't need glu.h
. It's only there to maintain compatibility with applications that depend on GLU via glew.h
. Isn't GLU
deprecated on the Mac nowadays?
from glew.
Oh, we're dealing in pre-compiled headers here? Ouch!
from glew.
Ouch indeed. include <OpenGL/glu.h>
is converted by clang into import OpenGL.GL.GLU
which triggers a full pre-compiled header load of everything in OpenGL. It's all fine if you load glu at the end though.
GLEW has been broken in XCode since version 5 because of this. That's when Apple enabled clang modules.
from glew.
I have not touched XCode much since the clang migration, I guess. GNU make works just fine, of course. :-)
from glew.
Is AE9RB/SwiftCGLEW abandoned at this point? I'm reading up about Swift, especially because there is a Linux version. But I'm still not sure what all the fuss is about.
from glew.
More problems came up the further I progressed. It got to where I had to fully parse gl.xml. At that point it was easy to do everything in Swift with no dependency on C code.
https://github.com/AE9RB/SwiftGL
I don't know what everyone else is doing in Swift. But it seems to me like a good language for 3D programming. Modern syntax. Fast and easy C calls. No indeterminate delays from a GC.
from glew.
At my workplace it's all about Julia, so Swift is probably not going to be on my radar, so much.
from glew.
Nothing further for this, for now.
from glew.
Related Issues (20)
- Runtime crash when attempting to use glClearTexImage() HOT 3
- Unclear how to use glew with EGL / Missing early no-EGLDisplay init HOT 3
- GLsizeiptr is supposed to be unsigned HOT 3
- How to compile glew on windows with osmesa?
- Use glew "locally"? HOT 1
- glewInit() fails if call EnableNonClientDpiScaling HOT 2
- Port python scripts to python3 HOT 4
- Files missings during build HOT 2
- Am I hallucinating or is there no include folder in the repo? HOT 2
- Is CMakeLists.txt maintained? HOT 4
- Isnβt `dllimport` obsolete? HOT 11
- How do I compile with make include 32 bit on Ubuntu 64 Bit?
- Change CMake min version HOT 4
- Undefined references when compiling source HOT 3
- Building library fails on cmake and Makefile HOT 3
- CMakeLists is illformed
- arm64 on mac HOT 18
- Suddenly can't build GLEW anymore HOT 5
- definition of GLsizeiptr is inconsistent with Khronos gl32.h on armel and armhf HOT 1
- cmake: Undefined reference to glx functions when build with non-standard prefix path
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glew.