Browse Source

Inital commit

Evgeniy Parfenyuk 3 tuần trước cách đây
commit
05cef3d6f2
5 tập tin đã thay đổi với 207 bổ sung0 xóa
  1. 61 0
      .clang-format
  2. 64 0
      .gitignore
  3. 39 0
      Makefile
  4. 1 0
      ext/raylib
  5. 42 0
      src/main.c

+ 61 - 0
.clang-format

@@ -0,0 +1,61 @@
+# Raylib C Coding Style Configuration
+
+BasedOnStyle: LLVM
+Language: Cpp
+
+# Indentation and spacing
+IndentWidth: 4
+TabWidth: 4
+UseTab: Never
+IndentCaseLabels: false
+
+# Brace style - Allman style
+BraceWrapping:
+  AfterCaseLabel: true
+  AfterClass: true
+  AfterControlStatement: Always
+  AfterEnum: true
+  AfterFunction: true
+  AfterNamespace: true
+  AfterStruct: true
+  AfterUnion: true
+  BeforeCatch: true
+  BeforeElse: true
+  IndentBraces: false
+
+# Line breaking and formatting
+ColumnLimit: 0
+MaxEmptyLinesToKeep: 1
+KeepEmptyLinesAtTheStartOfBlocks: false
+ReflowComments: false
+
+# Control statements
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLoopsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+BreakBeforeBraces: Custom
+
+# Include sorting
+IncludeCategories:
+  - Regex: '^"raylib.h"'
+    Priority: 1
+  - Regex: '^"raymath.h"'
+    Priority: 2
+  - Regex: '^"rlgl.h"'
+    Priority: 3
+  - Regex: '^<.*'
+    Priority: 4
+  - Regex: '.*'
+    Priority: 5
+
+SortIncludes: CaseSensitive
+
+# Other settings
+NamespaceIndentation: None
+AccessModifierOffset: -4
+IndentAccessModifiers: false
+AlignAfterOpenBracket: Align
+AlignOperands: Align
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+SpaceInEmptyParentheses: false

+ 64 - 0
.gitignore

@@ -0,0 +1,64 @@
+# Binary
+vinora
+
+# Prerequisites
+*.d
+
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+
+# Linker output
+*.ilk
+*.map
+*.exp
+
+# Vim backup files
+*.swp
+
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+*.lib
+*.a
+*.la
+*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+*.su
+*.idb
+*.pdb
+
+# Kernel Module Compile Results
+*.mod*
+*.cmd
+.tmp_versions/
+modules.order
+Module.symvers
+Mkfile.old
+dkms.conf
+
+# debug information files
+*.dwo
+
+

+ 39 - 0
Makefile

@@ -0,0 +1,39 @@
+CC       := gcc
+CFLAGS   := -Wall -Wextra -Wpedantic -Werror -std=c99
+INCLUDES := -Iext/raylib/src/
+LDFLAGS  := -Lext/raylib/src/
+LIBS     := -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
+
+TARGET   := vinora
+SRC_DIR  := src
+SOURCES  := $(wildcard $(SRC_DIR)/*.c)
+OBJECTS  := $(SOURCES:.c=.o)
+
+RAYLIB_DIR := ext/raylib/src
+
+all: raylib $(TARGET)
+
+raylib:
+	@$(MAKE) -C $(RAYLIB_DIR) PLATFORM=PLATFORM_DESKTOP -j2
+
+$(TARGET): raylib $(OBJECTS)
+	$(CC) $^ $(LDFLAGS) $(LIBS) -o $@
+
+%.o: %.c
+	$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+run: $(TARGET)
+	./$(TARGET)
+
+clean:
+	rm -f $(OBJECTS) $(TARGET)
+
+nuke: clean
+	@$(MAKE) -C $(RAYLIB_DIR) clean
+
+rebuild: clean all
+
+style-check:
+	clang-format -n $(SOURCES)
+
+.PHONY: all raylib run clean clean-all rebuild

+ 1 - 0
ext/raylib

@@ -0,0 +1 @@
+Subproject commit 0d78f10161f9d3df38b10bd33444451b7ee11eda

+ 42 - 0
src/main.c

@@ -0,0 +1,42 @@
+/*
+Vinora Engine -- simple and portable visual novels engine.
+
+Copyright (c) 2026 
+Evgeniy "Parthen" Parfenyuk <parthen [at] riseup.net>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <https://www.gnu.org/licenses/>.
+*/
+
+#include "raylib.h"
+
+int main(void)
+{
+    const int screenWidth = 800;
+    const int screenHeight = 600;
+
+    InitWindow(screenWidth, screenHeight, "Vinora Engine");
+
+    SetTargetFPS(60);
+
+    while (!WindowShouldClose())
+    {
+        BeginDrawing();
+        ClearBackground(RAYWHITE);
+        DrawText("Vinora Engine", 250, 280, 40, DARKGRAY);
+        EndDrawing();
+    }
+
+    CloseWindow();
+    return 0;
+}