Coder Social home page Coder Social logo

glarea-example's People

Contributors

ebassi avatar hadess avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

glarea-example's Issues

only a grey window displayed on Mac

This example works for me on openSUSE15.5.

I would however be interested on a working version for Mac also.

Some time ago, I could build it on a Mac Monterey, and it was okay (shader version 410 was necessary, as reported in #9). Most likely because of an update which happened meanwhile when doing brew install glm (glm was required by some code using the OpenGL core profile), it now still compiles, but shows a grey window only. On an older MacBook I have access to (with renderer Intel Iris Pro OpenGL Engine), it is the same (grey window); also other people reported a grey window on fairly new Mac M1 .

Is there any workaround known for this?

glarea-Mac-Monterey

Example without GtkApplication

Hi, Emmanuele.

Can you provide an example with just a single GtkWindow and GtkGlArea in a main.c (without GtkApplication, *.ui and other resources)? I'm trying to do just this, but it's not working.
Your application works at my lab notebook (which supports OpenGL 4.0), but not in my home notebook (which supports until OpenGL 2.1). It couldn't create a context, even though I use gtk_gl_area_set_required_version.

Thanks

Enhancement: Multi-sampling

This tutorial was really helpful in helping me port GTK2 OpenGL applications to GTK3. However, the resulting projects do not look as nice, as it is unclear how to enable multisampling with GTK3. This is best seen in high contrast edges, such as white on black. Below on the left is your GTK3 project with the background set to black and the top vertex set to white. Note the jagged appearance of the right triangle. The left is what is generated with GTK2 using x4 multisampling: the aliasing of the edges is much nicer, with partial volume represented by gray. Is there any way to enable multisampling with GTK3 OpenGL?

gtk3_vs_gtk2

GLSL version on Mac OS X

In case someone is having the same trouble as mine:

Apparently GTK-3 (installed via Homebrew) on Mac OS X Big Sur (Mac Book Pro 2015, Intel Iris Graphics 6100) requires a higher version of GLSL. The original code failed to compile:

Shader compilation failed: ERROR: 0:1: '' :  version '130' is not supported

410 worked.

diff --git a/glarea-app-window.c b/glarea-app-window.c
index cd78360..f7708b2 100644
--- a/glarea-app-window.c
+++ b/glarea-app-window.c
@@ -100,6 +100,8 @@ create_shader (int          shader_type,
                GError     **error,
                guint       *shader_out)
 {
+  printf("Supported GLSL version: %s\n", (char *)glGetString(GL_SHADING_LANGUAGE_VERSION));
+
   guint shader = glCreateShader (shader_type);
   glShaderSource (shader, 1, &source, NULL);
   glCompileShader (shader);
diff --git a/glarea-fragment.glsl b/glarea-fragment.glsl
index c331ad2..273ec33 100644
--- a/glarea-fragment.glsl
+++ b/glarea-fragment.glsl
@@ -1,4 +1,4 @@
-#version 130
+#version 410
 
 smooth in vec4 vertexColor;
 
diff --git a/glarea-vertex.glsl b/glarea-vertex.glsl
index 83dda48..9c36b3c 100644
--- a/glarea-vertex.glsl
+++ b/glarea-vertex.glsl
@@ -1,4 +1,4 @@
-#version 130
+#version 410
 
 in vec3 position;
 in vec3 color;

Flatpak not installable

The instructions in the README aren't up-to-date:

$ flatpak install --from http://ebassi.github.io/glarea-example/glarea-example.flatpakref
error: Can't load dependent file https://sdk.gnome.org/gnome.flatpakrepo: Error resolving “sdk.gnome.org”: Name or service not known

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.