From: Brendan Hansen Date: Tue, 21 Dec 2021 02:05:27 +0000 (-0600) Subject: updates to windows X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=443286c26fb3c096da7da7bf86b9140c6a424fc9;p=voxel-shooter.git updates to windows --- diff --git a/run_tree/lib/onyx_glfw3.dll b/run_tree/lib/onyx_glfw3.dll index ad2c4d4..abd19ac 100644 Binary files a/run_tree/lib/onyx_glfw3.dll and b/run_tree/lib/onyx_glfw3.dll differ diff --git a/run_tree/lib/onyx_opengles.dll b/run_tree/lib/onyx_opengles.dll index ac4d04b..d015f35 100644 Binary files a/run_tree/lib/onyx_opengles.dll and b/run_tree/lib/onyx_opengles.dll differ diff --git a/src/font.onyx b/src/font.onyx index fd8114b..fca42bb 100644 --- a/src/font.onyx +++ b/src/font.onyx @@ -88,10 +88,12 @@ font_make :: (fd: FontDescriptor) -> Font { texture: GLint; glGenTextures(1, ^texture); glBindTexture(GL_TEXTURE_2D, texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, texture_size, texture_size, 0, GL_ALPHA, GL_UNSIGNED_BYTE, pixels); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glBindTexture(GL_TEXTURE_2D, -1); + glBindTexture(GL_TEXTURE_2D, 0); font := Font.{ texture = texture, diff --git a/src/main.onyx b/src/main.onyx index 1d99298..747e2c2 100644 --- a/src/main.onyx +++ b/src/main.onyx @@ -4,14 +4,20 @@ use package glfw3 use package opengles use package stb_truetype use package core.intrinsics.onyx { __initialize } +#local runtime :: package runtime window: GLFWwindow_p; camera: Camera; create_window :: () => { - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); - glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); + #if runtime.OS == runtime.OS_Linux { + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); + glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); + } else { + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); + } window = glfwCreateWindow(1200, 720, #cstr "Voxel Shooter"); glfwMakeContextCurrent(window);