支持抗锯齿

This commit is contained in:
2025-08-23 12:19:28 +08:00
parent dd72a8e3fd
commit 1f7720d54e
23 changed files with 879 additions and 183 deletions
+7 -4
View File
@@ -14,13 +14,16 @@
#include <scene/dvc_scene.h>
int32_t g_screenWidth = 1024;
int32_t g_screenHeight = 768;
int32_t g_screenWidth = 2048;
int32_t g_screenHeight = 1024;
static SDL_Window* window = NULL;
AdapterTexture g_adapterTexture;
SDL_GLContext gl_context;
davinci::RenderTarget g_renderTarget;
davinci::AntiAliasingTech g_aaTech = davinci::AntiAliasingTech::AA_None;
int32_t g_canvasWidth = 1024;
int32_t g_canvasHeight = 512;
davinci::Scene g_scene;
//-------------------------------------------------------------------------------------
@@ -99,7 +102,7 @@ SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[])
// init davinci
g_scene.init();
g_renderTarget.init(512, 256);
g_renderTarget.init(g_canvasWidth, g_canvasHeight);
g_adapterTexture.updateTexture();
return SDL_APP_CONTINUE; /* carry on with the program! */
@@ -153,7 +156,7 @@ SDL_AppResult SDL_AppIterate(void* appstate)
//draw render result
g_adapterTexture.updateTexture(0, 0, g_renderTarget.getColorBuffer());
g_adapterTexture.updateTexture(512, 0, g_renderTarget.getDepthBuffer());
g_adapterTexture.updateTexture(g_canvasWidth, 0, g_renderTarget.getDepthBuffer());
g_adapterTexture.draw();
//draw ui