Render pipeline working.
This commit is contained in:
@ -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) {
|
||||
|
@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user