Skip to content

Commit

Permalink
Added startFrameBuffer with width and height
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardodoria committed Sep 21, 2024
1 parent aa40609 commit 0cfc409
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions engine/core/render/CameraRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ void CameraRender::startFrameBuffer(FramebufferRender* framebuffer, size_t face)
backend.startFrameBuffer(framebuffer, face);
}

void CameraRender::startFrameBuffer(int width, int height){
backend.startFrameBuffer(width, height);
}

void CameraRender::startFrameBuffer(){
backend.startFrameBuffer();
}
Expand Down
1 change: 1 addition & 0 deletions engine/core/render/CameraRender.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace Supernova{
void setClearColor(Vector4 clearColor);

void startFrameBuffer(FramebufferRender* framebuffer, size_t face = 0);
void startFrameBuffer(int width, int height);
void startFrameBuffer();

void applyViewport(Rect rect);
Expand Down
12 changes: 8 additions & 4 deletions engine/renders/sokol/SokolCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,20 @@ void SokolCamera::setClearColor(Vector4 clearColor){
}

void SokolCamera::startFrameBuffer(FramebufferRender* framebuffer, size_t face){
//sg_pass pass = {0};
//pass.action = pass_action;
pass.attachments = framebuffer->backend.get(face);
//SokolCmdQueue::add_command_begin_pass(pass);
sg_begin_pass(pass);
}

void SokolCamera::startFrameBuffer(int width, int height){
pass.swapchain = System::instance().getSokolSwapchain();
pass.swapchain.width = width;
pass.swapchain.height = height;
//SokolCmdQueue::add_command_begin_pass(pass);
sg_begin_pass(pass);
}

void SokolCamera::startFrameBuffer(){
//sg_pass pass = {0};
//pass.action = pass_action;
pass.swapchain = System::instance().getSokolSwapchain();
//SokolCmdQueue::add_command_begin_pass(pass);
sg_begin_pass(pass);
Expand Down
1 change: 1 addition & 0 deletions engine/renders/sokol/SokolCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace Supernova{
void setClearColor(Vector4 clearColor);

void startFrameBuffer(FramebufferRender* framebuffer, size_t face);
void startFrameBuffer(int width, int height);
void startFrameBuffer();

void applyViewport(Rect rect);
Expand Down

0 comments on commit 0cfc409

Please sign in to comment.