blackle / linux-opengl-examples Goto Github PK
View Code? Open in Web Editor NEWSome code examples for opening windows for various purposes in very few bytes
Some code examples for opening windows for various purposes in very few bytes
Firstly thank you so much for putting this out, it's super easy to use and I managed to compile my 4k graphics entry without any trouble. The file size ends up about 500 bytes bigger than the Crinkler processed Windows exe, but your Makefile workflow is so much nicer then trying to use Visual Studio's gui!
Anyway, here's the issue, I've never used C before so probably a newcomer mistake. When running make gtk-opengl
with the #define DEBUG
enabled, I get the following:
gcc -o gtk-opengl.elf gtk-opengl.c `pkg-config --cflags gtk+-3.0` -lGL -lgtk-3 -lgdk-3 -lgobject-2.0 -no-pie -fno-plt -Os -std=gnu11 -nostartfiles -nostdlib
gtk-opengl.c: In function ‘on_realize’:
gtk-opengl.c:62:23: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
glShaderSource(v, 1, &vshader, NULL);
^
In file included from /usr/include/GL/gl.h:2055:0,
from gtk-opengl.c:11:
/usr/include/GL/glext.h:777:21: note: expected ‘const GLchar * const* {aka const char * const*}’ but argument is of type ‘char **’
GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
^~~~~~~~~~~~~~
gtk-opengl.c: In function ‘_start’:
gtk-opengl.c:134:2: warning: ‘gdk_cursor_new’ is deprecated [-Wdeprecated-declarations]
GdkCursor* Cursor = gdk_cursor_new(GDK_BLANK_CURSOR);
^~~~~~~~~
In file included from /usr/include/gtk-3.0/gdk/gdk.h:34:0,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from gtk-opengl.c:9:
/usr/include/gtk-3.0/gdk/gdkcursor.h:228:12: note: declared here
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
^~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cchKw7fs.o: undefined reference to symbol 'exit@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:17: recipe for target 'gtk-opengl.elf' failed
make: *** [gtk-opengl.elf] Error 1
A bunch of warnings then this undefined reference to symbol 'exit@@GLIBC_2.2.5'
, which is strange because isn't that part of the standard library?
The reason I want to use DEBUG, is because sometimes I make shader errors and I have no easy way of finding them otherwise.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.