소스 검색

testbed: a bunch of components to start with

skypjack 10 달 전
부모
커밋
cb10854bc8
3개의 변경된 파일34개의 추가작업 그리고 0개의 파일을 삭제
  1. 16 0
      testbed/component/input_listener_component.h
  2. 11 0
      testbed/component/rect_component.h
  3. 7 0
      testbed/component/renderable_component.h

+ 16 - 0
testbed/component/input_listener_component.h

@@ -0,0 +1,16 @@
+#pragma once
+
+namespace testbed {
+
+struct input_listener_component {
+    enum class type {
+        UP,
+        DOWN,
+        LEFT,
+        RIGHT
+    };
+
+    type command;
+};
+
+} // namespace testbed

+ 11 - 0
testbed/component/rect_component.h

@@ -0,0 +1,11 @@
+#pragma once
+
+#include <SDL_rect.h>
+
+namespace testbed {
+
+struct rect_component {
+    SDL_Rect area;
+};
+
+} // namespace testbed

+ 7 - 0
testbed/component/renderable_component.h

@@ -0,0 +1,7 @@
+#pragma once
+
+namespace testbed {
+
+struct renderable_component {};
+
+} // namespace testbed