quantumde1 9 månader sedan
förälder
incheckning
4199ea2cc7
3 ändrade filer med 30 tillägg och 2 borttagningar
  1. 21 0
      LICENSE
  2. 1 1
      source/gl/base.c
  3. 8 1
      source/gl/fonts.c

+ 21 - 0
LICENSE

@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 Arseniy Mesherakov(quantumde1)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 1 - 1
source/gl/base.c

@@ -50,7 +50,7 @@ void glInit(int* pargc, char** argv, int width, int height, const char* title) {
     glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
     glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);
     glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE);
-    
+    glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
     window = glfwCreateWindow(width, height, title, NULL, NULL);
     if (!window) {
         fprintf(stderr, "Failed to create GLFW window\n");

+ 8 - 1
source/gl/fonts.c

@@ -215,6 +215,9 @@ void LoadFont(char* pathToFolder) {
     int currentSymbol = 0;
     
     while ((entry = readdir(fontFolder)) != NULL) {
+        if (currentSymbol == 256) {
+            break;
+        }
         if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) {
             continue;
         }
@@ -242,7 +245,11 @@ void DrawTextWithFont(unsigned char* text, int x, int y, float fontSize, Color c
     unsigned int currentX = x;
     while (text[currentSymbol] != '\0') {
         DrawTexture(fontTextures[text[currentSymbol]], currentX, y, fontSize, color);
-        currentX = currentX + fontTextures[text[currentSymbol]].width*fontSize;
+        if (fontSize < 1.0) {
+            currentX = currentX + fontTextures[text[currentSymbol]].width/2;
+        } else {
+            currentX = currentX + fontTextures[text[currentSymbol]].width*2;
+        }
         currentSymbol++;
     }
 }