mirror of
https://github.com/zhenyan121/SporeBG-Conid.git
synced 2026-04-10 06:14:08 +08:00
Let UI render on the physical screen rather than the logical screen
This commit is contained in:
@@ -6,16 +6,26 @@ public:
|
||||
WindowManager();
|
||||
~WindowManager();
|
||||
// 初始化
|
||||
bool Initialize(GameConfig& config);
|
||||
bool Initialize(WindowConfig& config);
|
||||
//关闭
|
||||
void Shutdown();
|
||||
//清理上一帧窗口
|
||||
|
||||
void beginWorld();
|
||||
|
||||
void endWorld();
|
||||
|
||||
void beginUI();
|
||||
|
||||
void endUI();
|
||||
|
||||
void Clear();
|
||||
//呈现窗口
|
||||
void Present();
|
||||
bool setFullscreen(bool isFullscreen);
|
||||
|
||||
|
||||
const Viewport& getViewport() const;
|
||||
|
||||
SDL_Renderer* GetRenderer();
|
||||
SDL_Window* GetWindow();
|
||||
|
||||
@@ -23,13 +33,15 @@ public:
|
||||
private:
|
||||
SDL_Window* m_window;
|
||||
SDL_Renderer* m_renderer;
|
||||
int m_logicalWidth;
|
||||
int m_logicalHeight;
|
||||
int m_windowWidth;
|
||||
int m_windowHeight;
|
||||
Viewport m_viewport;
|
||||
//int m_logicalWidth;
|
||||
//int m_logicalHeight;
|
||||
//int m_windowWidth;
|
||||
//int m_windowHeight;
|
||||
bool m_isFullscreen = false;
|
||||
SDL_Texture* m_logicalTexture = nullptr;
|
||||
// 计算缩放后的目标矩形
|
||||
void calculateDstRect(SDL_FRect& dstRect);
|
||||
//void calculateDstRect(SDL_FRect& dstRect);
|
||||
void onWindowResize();
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user