freeglut.sourceforge.io (#2352)

* freeglut.sourceforge.io

* +x.org/xinput

* deps

* +mesa

* deps & args

* oops

* double oops

* more test

* path to lib
This commit is contained in:
Andrew 2023-09-17 19:45:27 +03:00 committed by GitHub
parent 9fd3515e6e
commit c382e750d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 112 additions and 0 deletions

View file

@ -0,0 +1,54 @@
distributable:
url: https://github.com/FreeGLUTProject/freeglut/releases/download/v{{version}}/freeglut-{{version}}.tar.gz
strip-components: 1
versions:
github: FreeGLUTProject/freeglut
dependencies:
x.org/x11: '*'
x.org/xi: '*'
x.org/xrandr: '*'
x.org/xxf86vm: '*'
mesa3d.org: '*'
linux:
freedesktop.org/mesa-glu: '*'
x.org/xinput: '*'
build:
dependencies:
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
cmake.org: '*'
script:
- cmake $ARGS .
- make --jobs {{ hw.concurrency }} all
- make --jobs {{ hw.concurrency }} install
env:
ARGS:
- -DFREEGLUT_BUILD_DEMOS=OFF
- -DOPENGL_INCLUDE_DIR={{deps.mesa3d.org.prefix}}/include
- -DCMAKE_INSTALL_PREFIX={{prefix}}
- -DCMAKE_INSTALL_LIBDIR=lib
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_FIND_FRAMEWORK=LAST
- -DCMAKE_VERBOSE_MAKEFILE=ON
- -Wno-dev
- -DBUILD_TESTING=OFF
linux:
ARGS:
- -DOPENGL_gl_LIBRARY={{deps.mesa3d.org.prefix}}/lib/libGL.so.1
darwin:
ARGS:
- -DOPENGL_gl_LIBRARY={{deps.mesa3d.org.prefix}}/lib/libGL.1.dylib
test:
dependencies:
freedesktop.org/pkg-config: '*'
tea.xyz/gx/cc: c99
script:
- pkg-config --modversion glut | grep {{version}}
- cc test.c $(pkg-config --cflags --libs glut gl xext x11) -o test
# - ./test
# We cannot run ./test due to the absence of a display.

View file

@ -0,0 +1,58 @@
/*
* ------------------------------------------
* user_error_handler.c
*
* This is a sample program showing a basic
* user defined error handlers with FreeGLUT
* ------------------------------------------
*/
#include <GL/freeglut.h>
/*
* ------------------------------------------
* Declare our own Error handler for FreeGLUT
* ------------------------------------------
*/
/* This declares the vprintf() routine */
#include <stdio.h>
/* This declares the va_list type */
#include <stdarg.h>
/* The new handler looks like a vprintf prototype */
void myError (const char *fmt, va_list ap)
{
fprintf(stderr, "myError: Entering user defined error handler\n");
/* print warning message */
fprintf(stderr, "myError:");
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
/* deInitialize the freeglut state */
fprintf(stderr, "myError: Calling glutExit()\n");
glutExit();
/* terminate error handler appropriately */
fprintf(stderr, "myError: Exit-ing handler routine\n");
exit(1);
}
/*
* ------------------------------------------
* Just enough code to create the error to
* demonstrate the user defined handler
* ------------------------------------------
*/
int main(int argc, char** argv)
{
glutInitErrorFunc(&myError);
glutCreateWindow ("error test"); /* This is an error! */
glutInit(&argc, argv); /* Should be called
after glutInit() */
glutMainLoop();
return 0;
}