Render pipeline working.

This commit is contained in:
2021-05-20 22:47:26 -07:00
parent f6a4be2f3c
commit 8fbf353cd9
11 changed files with 53 additions and 41 deletions

View File

@ -15,6 +15,10 @@ bool gameInit(game_t *game) {
engineInit(&game->engine, game);
assetShaderLoad(&game->shader,"shaders/textured.vert","shaders/textured.frag");
assetTextureLoad(&game->texture, "cards_normal.png");
cubeInit(&game->primitive, 1, 1, 1);
// Init
// gameTimeInit();
// renderInit();
@ -48,7 +52,18 @@ bool gameInit(game_t *game) {
bool gameUpdate(game_t *game, float platformDelta) {
engineUpdateStart(&game->engine, game, platformDelta);
engineUpdateEnd(&game->engine, game);
cameraPerspective(&game->camera, 75,
((float)game->engine.render.width)/((float)game->engine.render.height),
0.01, 1000
);
cameraLookAt(&game->camera, 3, 3, 3, 0, 0, 0);
shaderUse(&game->shader);
shaderUseTexture(&game->shader, &game->texture);
shaderUseCamera(&game->shader, &game->camera);
shaderUsePosition(&game->shader, 0, 0, 0, 0, game->engine.time.current, 0);
primitiveDraw(&game->primitive, 0, -1);
// shaderUse(GAME_STATE.shaderWorld);// TODO: remove
@ -62,6 +77,8 @@ bool gameUpdate(game_t *game, float platformDelta) {
// holdemRenderFrameUseRight();
// holdemRenderWorld();
// holdemRenderFrameBack();
return engineUpdateEnd(&game->engine, game);
}
void gameDispose(game_t *game) {

View File

@ -7,6 +7,14 @@
#include <dawn/dawn.h>
#include "../engine/engine.h"
#include "../file/asset.h"
#include "../display/render.h"
#include "../display/primitive.h"
#include "../display/primitives/cube.h"
#include "../display/texture.h"
#include "../display/shader.h"
#include "../display/camera.h"
/**
* Initialize the game context.
*