Skip to content

Commit

Permalink
chore: add job system use example to reference renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan hoffstadt committed Apr 18, 2024
1 parent 8a23891 commit 78e60ca
Show file tree
Hide file tree
Showing 5 changed files with 213 additions and 128 deletions.
20 changes: 12 additions & 8 deletions apps/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,18 @@ pl_app_update(plAppData* ptAppData)
static const float fCameraRotationSpeed = 0.005f;

// camera space
if(pl_is_key_down(PL_KEY_W)) gptCamera->translate(ptCamera, 0.0f, 0.0f, fCameraTravelSpeed * ptIO->fDeltaTime);
if(pl_is_key_down(PL_KEY_S)) gptCamera->translate(ptCamera, 0.0f, 0.0f, -fCameraTravelSpeed* ptIO->fDeltaTime);
if(pl_is_key_down(PL_KEY_A)) gptCamera->translate(ptCamera, -fCameraTravelSpeed * ptIO->fDeltaTime, 0.0f, 0.0f);
if(pl_is_key_down(PL_KEY_D)) gptCamera->translate(ptCamera, fCameraTravelSpeed * ptIO->fDeltaTime, 0.0f, 0.0f);

// world space
if(pl_is_key_down(PL_KEY_F)) { gptCamera->translate(ptCamera, 0.0f, -fCameraTravelSpeed * ptIO->fDeltaTime, 0.0f); }
if(pl_is_key_down(PL_KEY_R)) { gptCamera->translate(ptCamera, 0.0f, fCameraTravelSpeed * ptIO->fDeltaTime, 0.0f); }
bool bOwnKeyboard = ptIO->bWantCaptureKeyboard;
if(!bOwnKeyboard)
{
if(pl_is_key_down(PL_KEY_W)) gptCamera->translate(ptCamera, 0.0f, 0.0f, fCameraTravelSpeed * ptIO->fDeltaTime);
if(pl_is_key_down(PL_KEY_S)) gptCamera->translate(ptCamera, 0.0f, 0.0f, -fCameraTravelSpeed* ptIO->fDeltaTime);
if(pl_is_key_down(PL_KEY_A)) gptCamera->translate(ptCamera, -fCameraTravelSpeed * ptIO->fDeltaTime, 0.0f, 0.0f);
if(pl_is_key_down(PL_KEY_D)) gptCamera->translate(ptCamera, fCameraTravelSpeed * ptIO->fDeltaTime, 0.0f, 0.0f);

// world space
if(pl_is_key_down(PL_KEY_F)) { gptCamera->translate(ptCamera, 0.0f, -fCameraTravelSpeed * ptIO->fDeltaTime, 0.0f); }
if(pl_is_key_down(PL_KEY_R)) { gptCamera->translate(ptCamera, 0.0f, fCameraTravelSpeed * ptIO->fDeltaTime, 0.0f); }
}

bool bOwnMouse = ptIO->bWantCaptureMouse;
if(!bOwnMouse && pl_is_mouse_dragging(PL_MOUSE_BUTTON_LEFT, 1.0f))
Expand Down
2 changes: 2 additions & 0 deletions extensions/pl_ecs_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ typedef struct _plTextureMap
char acName[PL_MAX_NAME_LENGTH];
plResourceHandle tResource;
uint32_t uUVSet;
uint32_t uWidth;
uint32_t uHeight;
} plTextureMap;

typedef struct _plAnimationSampler
Expand Down
Loading

0 comments on commit 78e60ca

Please sign in to comment.