mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 05:31:00 +00:00
- deleted now useless code from Cocoa backend
Let's rely on cross-platform code to manage window dimensions and screen resolution
This commit is contained in:
parent
f8f1148c59
commit
352f93c066
2 changed files with 0 additions and 43 deletions
|
@ -37,22 +37,6 @@
|
||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
|
|
||||||
|
|
||||||
struct RenderBufferOptions
|
|
||||||
{
|
|
||||||
float pixelScale;
|
|
||||||
|
|
||||||
float shiftX;
|
|
||||||
float shiftY;
|
|
||||||
|
|
||||||
float width;
|
|
||||||
float height;
|
|
||||||
|
|
||||||
bool dirty;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern RenderBufferOptions rbOpts;
|
|
||||||
|
|
||||||
|
|
||||||
// Version of AppKit framework we are interested in
|
// Version of AppKit framework we are interested in
|
||||||
// The following values are needed to build with earlier SDKs
|
// The following values are needed to build with earlier SDKs
|
||||||
|
|
||||||
|
|
|
@ -115,9 +115,6 @@ CUSTOM_CVAR(Bool, vid_autoswitch, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_
|
||||||
EXTERN_CVAR(Bool, gl_smooth_rendered)
|
EXTERN_CVAR(Bool, gl_smooth_rendered)
|
||||||
|
|
||||||
|
|
||||||
RenderBufferOptions rbOpts;
|
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
@ -544,20 +541,6 @@ void CocoaVideo::SetFullscreenMode(const int width, const int height)
|
||||||
? [screen convertRectToBacking:screenFrame]
|
? [screen convertRectToBacking:screenFrame]
|
||||||
: screenFrame;
|
: screenFrame;
|
||||||
|
|
||||||
const float displayWidth = displayRect.size.width;
|
|
||||||
const float displayHeight = displayRect.size.height;
|
|
||||||
|
|
||||||
const float pixelScaleFactorX = displayWidth / static_cast<float>(width );
|
|
||||||
const float pixelScaleFactorY = displayHeight / static_cast<float>(height);
|
|
||||||
|
|
||||||
rbOpts.pixelScale = MIN(pixelScaleFactorX, pixelScaleFactorY);
|
|
||||||
|
|
||||||
rbOpts.width = width * rbOpts.pixelScale;
|
|
||||||
rbOpts.height = height * rbOpts.pixelScale;
|
|
||||||
|
|
||||||
rbOpts.shiftX = (displayWidth - rbOpts.width ) / 2.0f;
|
|
||||||
rbOpts.shiftY = (displayHeight - rbOpts.height) / 2.0f;
|
|
||||||
|
|
||||||
if (!m_fullscreen)
|
if (!m_fullscreen)
|
||||||
{
|
{
|
||||||
[m_window setLevel:LEVEL_FULLSCREEN];
|
[m_window setLevel:LEVEL_FULLSCREEN];
|
||||||
|
@ -571,14 +554,6 @@ void CocoaVideo::SetFullscreenMode(const int width, const int height)
|
||||||
|
|
||||||
void CocoaVideo::SetWindowedMode(const int width, const int height)
|
void CocoaVideo::SetWindowedMode(const int width, const int height)
|
||||||
{
|
{
|
||||||
rbOpts.pixelScale = 1.0f;
|
|
||||||
|
|
||||||
rbOpts.width = static_cast<float>(width );
|
|
||||||
rbOpts.height = static_cast<float>(height);
|
|
||||||
|
|
||||||
rbOpts.shiftX = 0.0f;
|
|
||||||
rbOpts.shiftY = 0.0f;
|
|
||||||
|
|
||||||
const NSSize windowPixelSize = NSMakeSize(width, height);
|
const NSSize windowPixelSize = NSMakeSize(width, height);
|
||||||
const NSSize windowSize = vid_hidpi
|
const NSSize windowSize = vid_hidpi
|
||||||
? [[m_window contentView] convertSizeFromBacking:windowPixelSize]
|
? [[m_window contentView] convertSizeFromBacking:windowPixelSize]
|
||||||
|
@ -621,8 +596,6 @@ void CocoaVideo::SetMode(const int width, const int height, const bool fullscree
|
||||||
SetWindowedMode(width, height);
|
SetWindowedMode(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
rbOpts.dirty = true;
|
|
||||||
|
|
||||||
const NSSize viewSize = I_GetContentViewSize(m_window);
|
const NSSize viewSize = I_GetContentViewSize(m_window);
|
||||||
|
|
||||||
glViewport(0, 0, static_cast<GLsizei>(viewSize.width), static_cast<GLsizei>(viewSize.height));
|
glViewport(0, 0, static_cast<GLsizei>(viewSize.width), static_cast<GLsizei>(viewSize.height));
|
||||||
|
|
Loading…
Reference in a new issue