This commit is contained in:
2026-07-14 13:07:13 +01:00
parent 7a9b44a735
commit a9054b3be4
5 changed files with 31 additions and 14 deletions
+15 -8
View File
@@ -1,20 +1,27 @@
{
description = "game";
description = "game engine";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
outputs =
{ self, nixpkgs }:
let
systems = [ "x86_64-linux" ];
forAllSystems = f:
nixpkgs.lib.genAttrs systems (system:
f (import nixpkgs {
inherit system;
}));
in {
forAllSystems =
f:
nixpkgs.lib.genAttrs systems (
system:
f (
import nixpkgs {
inherit system;
}
)
);
in
{
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
+2 -2
View File
@@ -73,8 +73,8 @@ private:
};
struct ERect : Element {
Color color = {255, 255, 255};
Vec2<float> shape = {0, 0};
Color color = {255, 255, 255};
Vec2<float> size() override;
@@ -97,4 +97,4 @@ struct EWorld : Element {
inline Pool<Element> element_pool;
} // namespace app
#endif
#endif
+6 -2
View File
@@ -3,8 +3,12 @@
#include "utils.h"
struct Entity;
struct Entity {};
struct Component;
struct System;
#endif
struct EntityPool {
Entity entities[];
};
#endif
+7 -1
View File
@@ -58,12 +58,18 @@ rect.click do
end
App.map_key :mouse_left, :action_name
App.map_key :q, :quit
start = Time.now
c_ = 0.0
c_c = 0
App.update do |delta_time|
if App.pressed?(:quit)
App.exit!
next
end
c_ += delta_time
c_c += 1
@@ -114,4 +120,4 @@ p "Average delta time: #{c_ / c_c}s"
p "Average FPS (real): #{c_c / time}s"
p "Average FPS (from dt): #{c_c / c_}"
p "Time since start (real): #{time}s"
p "Time since start (from dt): #{c_}s"
p "Time since start (from dt): #{c_}s"
+1 -1
View File
@@ -108,4 +108,4 @@ void App::loop() {
window.clear();
}
}
} // namespace app
} // namespace app