Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

game of life using win32 #49

Merged
merged 10 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Check everything
run: |
FLAGS="-vet -strict-style -vet-tabs -disallow-do -warnings-as-errors"

odin check by_example/dir_info $FLAGS
odin check by_example/dynamic_arrays $FLAGS
odin check by_example/hellope $FLAGS
Expand All @@ -57,7 +57,7 @@ jobs:

odin check math/noise/draw_texture $FLAGS

odin check raylib/game_of_life $FLAGS
odin check raylib/game_of_life $FLAGS
odin check raylib/microui $FLAGS
odin check raylib/ports/shaders/shaders_mesh_instancing.odin -file $FLAGS
odin check raylib/ports/shapes/shapes_basic_shapes.odin -file $FLAGS
Expand All @@ -76,3 +76,5 @@ jobs:
odin check sdl2/opengl $FLAGS

odin check wgpu/microui -target:windows_amd64 $FLAGS

odin check win32/game_of_life $FLAGS
Hyrtwol marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 3 additions & 4 deletions raylib/game_of_life/game_of_life.odin
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package game_of_life

/*********************************************************************
GAME OF LIFE
(using raylib)
(using raylib)

This example shows a simple setup for a game with Input processing,
updating game state and drawing game state to the screen.
Expand All @@ -13,7 +13,7 @@ package game_of_life
* Press <Space> to (un)pause the game
* Press <Esc> to close the game

The game starts paused.
The game starts paused.

**********************************************************************/

Expand Down Expand Up @@ -60,7 +60,6 @@ User_Input :: struct {
}



/*
Game Of Life rules:
* (1) A cell with 2 alive neighbors stays alive/dead
Expand All @@ -85,7 +84,7 @@ update_world :: #force_inline proc(world: ^World, next_world: ^World) {
}

/*
Just a branch-less version of adding adding all neighbors together
Just a branch-less version of adding adding all neighbors together
*/
count_neighbors :: #force_inline proc(w: ^World, x: i32, y: i32) -> u8 {
// our world is a torus!
Expand Down
Binary file added win32/emblem.ico
Binary file not shown.
14 changes: 14 additions & 0 deletions win32/game_of_life/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@echo off
set odin_cmd=build
set odin_opt=-resource:game_of_life.rc
if "%1" NEQ "" set odin_cmd=%1
if "%2" NEQ "" set odin_opt=%odin_opt% %2
rem select code page with utf-8 support CP_UTF8
chcp 65001
rem setup VC needed for -resource
if "%VSCMD_ARG_TGT_ARCH%"=="" call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
Hyrtwol marked this conversation as resolved.
Show resolved Hide resolved
pushd %~dp0
@echo on
odin %odin_cmd% . %odin_opt%
@echo off
popd
Loading
Loading