Code Monkey home page Code Monkey logo

Comments (12)

bayi avatar bayi commented on May 21, 2024

Hi, currently the project is building fine under linux, but its not running because some BSD code and other "small issues" i already tried to dig into it and see if i can fix it if yes ill send a PR.

The qsort_r issue is already solved, now im getting segfauls from the camera init code...

Edit: spelling

from minecraft-weekend.

bayi avatar bayi commented on May 21, 2024

Also see #6

from minecraft-weekend.

jdah avatar jdah commented on May 21, 2024

I have a version which segfaults under Ubuntu on camera creation but does not fail to create a window. Can you provide any extra info about your graphics setup? I imagine that could be causing the issue if GLFW doesn't like your system.

from minecraft-weekend.

jurakin avatar jurakin commented on May 21, 2024

I have Lenovo ThinkPad t410 with these parameters:

  • Graphic card: Intel HD Graphics,
  • Processor: Intel Core i5 520M 2.4 GHz,
  • Ram: 4GB.

from minecraft-weekend.

bayi avatar bayi commented on May 21, 2024

Wow thats a really old cpu, regarding intel ive ran the new build and fixed code on a Core i7 4770 succesfully, so the driver code is not the issue, i bet also on GFLW requiring something that older cpu integrated graphics doesnt have.

from minecraft-weekend.

TheArcaneBrony avatar TheArcaneBrony commented on May 21, 2024

can reproduce error creating window under WSL. Works fine on a physical linux machine.

from minecraft-weekend.

lindevel avatar lindevel commented on May 21, 2024

Arch Linux, same

from minecraft-weekend.

lindevel avatar lindevel commented on May 21, 2024
GLFW Error: GLX: Failed to create context: GLXBadFBConfig
error creating window

The reason for the error is in the required OpenGL version, you need support for 4.1 core profile

from minecraft-weekend.

lindevel avatar lindevel commented on May 21, 2024

Here is a patch to downgrade the required OpenGL version to 3.3 core profile

diff --git a/res/shaders/basic2d.fs b/res/shaders/basic2d.fs
index 2d30ccf..be71b72 100644
--- a/res/shaders/basic2d.fs
+++ b/res/shaders/basic2d.fs
@@ -1,4 +1,4 @@
-#version 410
+#version 330
 
 uniform sampler2D tex;
 uniform bool use_tex;
diff --git a/res/shaders/basic2d.vs b/res/shaders/basic2d.vs
index f870819..c320dcc 100644
--- a/res/shaders/basic2d.vs
+++ b/res/shaders/basic2d.vs
@@ -1,4 +1,4 @@
-#version 410
+#version 330
 
 layout (location = 0) in vec3 position;
 layout (location = 1) in vec2 uv;
diff --git a/res/shaders/basic_color.fs b/res/shaders/basic_color.fs
index 2505b37..32ed7bb 100644
--- a/res/shaders/basic_color.fs
+++ b/res/shaders/basic_color.fs
@@ -1,4 +1,4 @@
-#version 410
+#version 330
 
 uniform vec4 color;
 
diff --git a/res/shaders/basic_color.vs b/res/shaders/basic_color.vs
index ef9359e..718a206 100644
--- a/res/shaders/basic_color.vs
+++ b/res/shaders/basic_color.vs
@@ -1,4 +1,4 @@
-#version 410
+#version 330
 
 layout (location = 0) in vec3 position;
 
diff --git a/res/shaders/basic_texture.fs b/res/shaders/basic_texture.fs
index e9e5b1b..f79c60e 100644
--- a/res/shaders/basic_texture.fs
+++ b/res/shaders/basic_texture.fs
@@ -1,4 +1,4 @@
-#version 410
+#version 330
 
 uniform sampler2D tex;
 uniform vec4 color;
diff --git a/res/shaders/basic_texture.vs b/res/shaders/basic_texture.vs
index 0a6d918..ffc7369 100644
--- a/res/shaders/basic_texture.vs
+++ b/res/shaders/basic_texture.vs
@@ -1,4 +1,4 @@
-#version 410
+#version 330
 
 layout (location = 0) in vec3 position;
 layout (location = 1) in vec2 uv;
diff --git a/res/shaders/chunk.fs b/res/shaders/chunk.fs
index 54aaf1a..2db4fa1 100644
--- a/res/shaders/chunk.fs
+++ b/res/shaders/chunk.fs
@@ -1,4 +1,4 @@
-#version 410
+#version 330
 
 uniform sampler2D tex;
 
diff --git a/res/shaders/chunk.vs b/res/shaders/chunk.vs
index 0f3b7a4..c1c5902 100644
--- a/res/shaders/chunk.vs
+++ b/res/shaders/chunk.vs
@@ -1,4 +1,4 @@
-#version 410
+#version 330
 
 layout (location = 0) in vec3 position;
 layout (location = 1) in vec2 uv;
@@ -9,12 +9,12 @@ uniform mat4 m, v, p;
 uniform vec4 sunlight_color;
 
 // should match enum Direction in direction.h
-const uint NORTH = 0;
-const uint SOUTH = 1;
-const uint EAST = 2;
-const uint WEST = 3;
-const uint UP = 4;
-const uint DOWN = 5;
+const uint NORTH = 0U;
+const uint SOUTH = 1U;
+const uint EAST = 2U;
+const uint WEST = 3U;
+const uint UP = 4U;
+const uint DOWN = 5U;
 
 out vec4 v_color;
 out vec2 v_uv;
diff --git a/res/shaders/sky.fs b/res/shaders/sky.fs
index d58fd0e..7fe1805 100644
--- a/res/shaders/sky.fs
+++ b/res/shaders/sky.fs
@@ -1,4 +1,4 @@
-#version 410
+#version 330
 
 uniform sampler2D tex;
 uniform bool use_tex;
diff --git a/res/shaders/sky.vs b/res/shaders/sky.vs
index 8ce2a55..1b0bddd 100644
--- a/res/shaders/sky.vs
+++ b/res/shaders/sky.vs
@@ -1,4 +1,4 @@
-#version 410
+#version 330
 
 layout (location = 0) in vec3 position;
 layout (location = 1) in vec2 uv;
diff --git a/src/gfx/window.c b/src/gfx/window.c
index b4973bf..2c0bf93 100644
--- a/src/gfx/window.c
+++ b/src/gfx/window.c
@@ -77,8 +77,8 @@ void window_create(FWindow init, FWindow destroy, FWindow tick,  FWindow update,
     }
 
     glfwWindowHint(GLFW_RESIZABLE, GL_TRUE);
-	glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
-	glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
+	glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
+	glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
 	glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
 	glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);

from minecraft-weekend.

jdah avatar jdah commented on May 21, 2024

@lindevel @jurajhonsch this has been fixed with 1c14fc3 (thanks @lindevel), can either of you confirm that the new changes work?

from minecraft-weekend.

lindevel avatar lindevel commented on May 21, 2024

Yes it works

from minecraft-weekend.

jdah avatar jdah commented on May 21, 2024

@lindevel Great! closing this then.

from minecraft-weekend.

Related Issues (20)

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.