-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
335 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# OSGL | ||
|
||
OSGL is an open source, cross-platform library designed to simplify the use of OpenGL in headless environments. It uses OS and vendor specific extensions, as well as EGL to aquire an OpenGL context without needing to go through the window manager. It will fallback to providing a software OpenGL context using OSMesa if getting a hardware context fails. | ||
|
||
Getting an OpenGL context is now as simple as this: | ||
``` | ||
#include <osgl/GLContextProvider.h> | ||
#include <osgl/GLInclude.h> | ||
int main(int argc, char **argv) | ||
{ | ||
auto ctx = OSGL::GLContextProvider::CreateContext(); | ||
printf("OpenGL Context: %s\n", glGetString(GL_VERSION)); | ||
return 0; | ||
} | ||
``` | ||
|
||
Since the context will not be bound to a window, you need to create and bind your own target framebuffer. An complete example can be found in `tests/test_framebuffer.cpp`. | ||
|
||
OSGL currently supports macOS and Linux. Windows support is planned. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/sh | ||
|
||
# Inputs | ||
[[ -z "$DEBUG" ]] && DEBUG=false | ||
|
||
CMAKE_EXTRA="" | ||
|
||
# The env can be either PREFIX or BUILD_PREFIX depending on the build requirements. | ||
# Conda does not configure its variables accordingly. | ||
export ENV="$BUILD_PREFIX" | ||
export PATH="$ENV/bin:$PATH" | ||
|
||
if $DEBUG; then | ||
# If optimizations are disabled, need to disable fortify source otherwise will get barraged with warnings | ||
export CPPFLAGS="`echo $CPPFLAGS|sed 's/-D_FORTIFY_SOURCE=2//g'`" | ||
CMAKE_EXTRA="$CMAKE_EXTRA -DCMAKE_BUILD_TYPE=Debug" | ||
else | ||
CMAKE_EXTRA="$CMAKE_EXTRA -DCMAKE_BUILD_TYPE=Release" | ||
fi | ||
|
||
export CPPFLAGS="$CPPFLAGS -isystem $ENV/include" | ||
|
||
# cmake ignores CPPFLAGS | ||
export CXXFLAGS="$CXXFLAGS $CPPFLAGS" | ||
export CFLAGS="$CFLAGS $CPPFLAGS" | ||
|
||
# Conda will sometimes set these to invalid values which end up breaking the build | ||
unset CMAKE_ARGS | ||
unset CMAKE_PREFIX_PATH | ||
|
||
# Prevent linking outside libraries | ||
export CMAKE_LIBRARY_PATH="$PREFIX/lib:$BUILD_PREFIX/lib" | ||
export CMAKE_PREFIX_PATH="$PREFIX:$BUILD_PREFIX" | ||
|
||
mkdir build | ||
cd build | ||
|
||
cmake .. \ | ||
-DCMAKE_INSTALL_PREFIX="$PREFIX" \ | ||
$CMAKE_EXTRA \ | ||
|
||
make -j$(($CPU_COUNT+1)) | ||
make install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package: | ||
name: osgl | ||
version: "0.9.0" | ||
|
||
source: | ||
path: .. | ||
|
||
build: | ||
script_env: | ||
- DEBUG | ||
|
||
requirements: | ||
build: | ||
- {{ compiler('cxx') }} | ||
- make=4.3 | ||
- cmake=3.21.3 | ||
- mesalib=21.2.5 # [not win] | ||
- libcxx=14.0 # [not win] | ||
- libcxx # [win] | ||
run: | ||
- {{ pin_compatible('mesalib') }} # [not win] | ||
- {{ pin_compatible('libcxx') }} |
File renamed without changes.
Oops, something went wrong.