FPS
This commit is contained in:
@@ -21,5 +21,4 @@ typedef struct {
|
||||
void (*render)(scenedata_t *data);
|
||||
void (*dispose)(scenedata_t *data);
|
||||
uint8_t flags;
|
||||
color_t background;
|
||||
} scene_t;
|
||||
@@ -7,6 +7,7 @@
|
||||
target_sources(${DUSK_TARGET_NAME}
|
||||
PRIVATE
|
||||
scenetest.c
|
||||
scenemap.c
|
||||
)
|
||||
|
||||
# Subdirs
|
||||
22
src/scene/scene/scenemap.c
Normal file
22
src/scene/scene/scenemap.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "scenemap.h"
|
||||
|
||||
errorret_t sceneMapInit(scenedata_t *data) {
|
||||
errorOk();
|
||||
}
|
||||
|
||||
void sceneMapUpdate(scenedata_t *data) {
|
||||
}
|
||||
|
||||
void sceneMapRender(scenedata_t *data) {
|
||||
|
||||
}
|
||||
|
||||
void sceneMapDispose(scenedata_t *data) {
|
||||
}
|
||||
27
src/scene/scene/scenemap.h
Normal file
27
src/scene/scene/scenemap.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "scene/scene.h"
|
||||
|
||||
typedef struct {
|
||||
int32_t nothing;
|
||||
} scenemap_t;
|
||||
|
||||
errorret_t sceneMapInit(scenedata_t *data);
|
||||
void sceneMapUpdate(scenedata_t *data);
|
||||
void sceneMapRender(scenedata_t *data);
|
||||
void sceneMapDispose(scenedata_t *data);
|
||||
|
||||
static scene_t SCENE_MAP = {
|
||||
.name = "map",
|
||||
.init = sceneMapInit,
|
||||
.update = sceneMapUpdate,
|
||||
.render = sceneMapRender,
|
||||
.dispose = sceneMapDispose,
|
||||
.flags = 0
|
||||
};
|
||||
@@ -9,9 +9,11 @@
|
||||
#include "scene/scene.h"
|
||||
|
||||
#include "scene/scene/scenetest.h"
|
||||
#include "scene/scene/scenemap.h"
|
||||
|
||||
typedef struct scenedata_s {
|
||||
union {
|
||||
scenetest_t sceneTest;
|
||||
scenemap_t sceneMap;
|
||||
};
|
||||
} scenedata_t;
|
||||
|
||||
@@ -18,6 +18,7 @@ errorret_t sceneManagerInit(void) {
|
||||
memoryZero(&SCENE_MANAGER, sizeof(scenemanager_t));
|
||||
|
||||
sceneManagerRegisterScene(&SCENE_TEST);
|
||||
sceneManagerRegisterScene(&SCENE_MAP);
|
||||
|
||||
errorOk();
|
||||
}
|
||||
@@ -91,11 +92,6 @@ void sceneManagerRender(void) {
|
||||
SCENE_MANAGER.current->flags & SCENE_FLAG_INITIALIZED,
|
||||
"Current scene not initialized"
|
||||
);
|
||||
|
||||
frameBufferClear(
|
||||
FRAMEBUFFER_CLEAR_COLOR | FRAMEBUFFER_CLEAR_DEPTH,
|
||||
SCENE_MANAGER.current->background
|
||||
);
|
||||
|
||||
if(SCENE_MANAGER.current->render) {
|
||||
SCENE_MANAGER.current->render(&SCENE_MANAGER.sceneData);
|
||||
|
||||
Reference in New Issue
Block a user