https://github.com/zacharycarter/zengine
2D | 3D Game development library
https://github.com/zacharycarter/zengine
2d 3d game-development game-engine nim
Last synced: 13 days ago
JSON representation
2D | 3D Game development library
- Host: GitHub
- URL: https://github.com/zacharycarter/zengine
- Owner: zacharycarter
- Archived: true
- Created: 2017-07-08T15:06:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-03T21:29:50.000Z (over 7 years ago)
- Last Synced: 2024-08-04T01:15:21.552Z (10 months ago)
- Topics: 2d, 3d, game-development, game-engine, nim
- Language: Nim
- Homepage:
- Size: 58.5 MB
- Stars: 156
- Watchers: 9
- Forks: 13
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zengine
2D | 3D Game development libraryNOTE - Please run examples from root directory for now
Progress -




Dependencies:
[Assimp](https://github.com/assimp/assimp)```nim
import zengine, sdl2, opengltype
LightKind = enum
Point, Directional, Spot
Light = ref object
id: int
enabled: bool
kind: LightKind
position: Vector3
target: Vector3
radius: float
diffuse: ZColor
intensity: float
coneAngle: floatconst
WIDTH = 960
HEIGHT = 540
MAX_LIGHTS = 8var lights: array[MAX_LIGHTS, Light]
var lightsCount = 0
var lightsLocs: array[MAX_LIGHTS, array[8, int]]proc createLight(kind: LightKind, position: Vector3, diffuse: ZColor): Light =
result = nilif lightsCount < MAX_LIGHTS:
result = Light(
id: lightsCount,
kind: kind,
enabled: true,
position: position,
target: vectorZero(),
intensity: 1.0,
diffuse: diffuse
)lights[lightsCount] = result
inc(lightsCount)
else:
result = lights[lightsCount]proc setShaderLightsValues(shader: Shader) =
var tempInt: array[8, GLint]
var tempFloat: array[8, GLfloat]for i in 0..