Added presentation parameters in GSH_OpenGL (to move in GSHandler maybe).

Added support for window resizing and full screen on MacOSX.
Updated MacOSX project.

git-svn-id: http://svn.purei.org/purei/trunk@986 b36208d7-6611-0410-8bec-b1987f11c4a2
This commit is contained in:
jpd002 2012-09-05 00:08:05 +00:00
parent 77fb19172a
commit 1a2379e41f
12 changed files with 1634 additions and 1349 deletions

View File

@ -36,6 +36,9 @@ CGSH_OpenGL::CGSH_OpenGL()
m_pCvtBuffer = new uint8[CVTBUFFERSIZE];
memset(&m_renderState, 0, sizeof(m_renderState));
m_presentationParams.windowWidth = 512;
m_presentationParams.windowHeight = 384;
}
CGSH_OpenGL::~CGSH_OpenGL()
@ -48,8 +51,8 @@ void CGSH_OpenGL::InitializeImpl()
InitializeRC();
m_nVtxCount = 0;
m_nWidth = -1;
m_nHeight = -1;
m_displayWidth = 0;
m_displayHeight = 0;
memset(m_clampMin, 0, sizeof(m_clampMin));
memset(m_clampMax, 0, sizeof(m_clampMax));
@ -80,9 +83,56 @@ void CGSH_OpenGL::FlipImpl()
{
PresentBackbuffer();
CGSHandler::FlipImpl();
#ifdef _WIREFRAME
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
#endif
glClearColor(0, 0, 0, 1);
glViewport(0, 0, m_presentationParams.windowWidth, m_presentationParams.windowHeight);
glClear(GL_COLOR_BUFFER_BIT);
unsigned int sourceWidth = GetCrtWidth();
unsigned int sourceHeight = GetCrtHeight();
switch(m_presentationParams.mode)
{
case PRESENTATION_MODE_FILL:
glViewport(0, 0, m_presentationParams.windowWidth, m_presentationParams.windowHeight);
break;
case PRESENTATION_MODE_FIT:
{
int viewportWidth[2];
int viewportHeight[2];
{
viewportWidth[0] = m_presentationParams.windowWidth;
viewportHeight[0] = (sourceWidth != 0) ? (m_presentationParams.windowWidth * sourceHeight) / sourceWidth : 0;
}
{
viewportWidth[1] = (sourceHeight != 0) ? (m_presentationParams.windowHeight * sourceWidth) / sourceHeight : 0;
viewportHeight[1] = m_presentationParams.windowHeight;
}
int selectedViewport = 0;
if(
(viewportWidth[0] > m_presentationParams.windowWidth) ||
(viewportHeight[0] > m_presentationParams.windowHeight)
)
{
selectedViewport = 1;
assert(
viewportWidth[1] <= m_presentationParams.windowWidth &&
viewportHeight[1] <= m_presentationParams.windowHeight);
}
int offsetX = (m_presentationParams.windowWidth - viewportWidth[selectedViewport]) / 2;
int offsetY = (m_presentationParams.windowHeight - viewportHeight[selectedViewport]) / 2;
glViewport(offsetX, offsetY, viewportWidth[selectedViewport], viewportHeight[selectedViewport]);
}
break;
case PRESENTATION_MODE_ORIGINAL:
{
int offsetX = (m_presentationParams.windowWidth - sourceWidth) / 2;
int offsetY = (m_presentationParams.windowHeight - sourceHeight) / 2;
glViewport(offsetX, offsetY, sourceWidth, sourceHeight);
}
break;
}
assert(glGetError() == GL_NO_ERROR);
}
void CGSH_OpenGL::LoadState(Framework::CZipArchiveReader& archive)
@ -92,6 +142,11 @@ void CGSH_OpenGL::LoadState(Framework::CZipArchiveReader& archive)
m_mailBox.SendCall(std::bind(&CGSH_OpenGL::TexCache_InvalidateTextures, this, 0, RAMSIZE));
}
void CGSH_OpenGL::SetPresentationParams(const PRESENTATION_PARAMS& presentationParams)
{
m_presentationParams = presentationParams;
}
void CGSH_OpenGL::LoadSettings()
{
CGSHandler::LoadSettings();
@ -131,10 +186,6 @@ void CGSH_OpenGL::InitializeRC()
m_pTexUploader_Psm16 = &CGSH_OpenGL::TexUploader_Psm16_Hw;
}
SetViewport(512, 384);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
#ifdef _WIREFRAME
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glDisable(GL_TEXTURE_2D);
@ -207,16 +258,15 @@ void CGSH_OpenGL::UpdateViewportImpl()
nH /= 2;
}
if(m_nWidth == nW && m_nHeight == nH)
if(m_displayWidth == nW && m_displayHeight == nH)
{
return;
}
m_nWidth = nW;
m_nHeight = nH;
m_displayWidth = nW;
m_displayHeight = nH;
SetViewport(GetCrtWidth(), GetCrtHeight());
SetReadCircuitMatrix(m_nWidth, m_nHeight);
SetReadCircuitMatrix(m_displayWidth, m_displayHeight);
}
unsigned int CGSH_OpenGL::GetCurrentReadCircuit()
@ -228,11 +278,6 @@ unsigned int CGSH_OpenGL::GetCurrentReadCircuit()
return 0;
}
void CGSH_OpenGL::SetViewport(int nWidth, int nHeight)
{
glViewport(0, 0, nWidth, nHeight);
}
void CGSH_OpenGL::SetReadCircuitMatrix(int nWidth, int nHeight)
{
glMatrixMode(GL_PROJECTION);
@ -1275,7 +1320,7 @@ void CGSH_OpenGL::ProcessImageTransfer(uint32 nAddress, uint32 nLength)
TexCache_InvalidateTextures(nAddress, nLength);
uint32 nFrameEnd = (pFrame->GetBasePtr() + (pFrame->GetWidth() * GetPsmPixelSize(pFrame->nPsm) / 8) * m_nHeight);
uint32 nFrameEnd = (pFrame->GetBasePtr() + (pFrame->GetWidth() * GetPsmPixelSize(pFrame->nPsm) / 8) * m_displayHeight);
if(nAddress < nFrameEnd)
{
if((pFrame->nPsm == PSMCT24) && (pBuf->nDstPsm == PSMT4HH || pBuf->nDstPsm == PSMT4HL || pBuf->nDstPsm == PSMT8H)) return;

View File

@ -15,11 +15,26 @@
class CGSH_OpenGL : public CGSHandler
{
public:
enum PRESENTATION_MODE
{
PRESENTATION_MODE_FILL,
PRESENTATION_MODE_FIT,
PRESENTATION_MODE_ORIGINAL
};
struct PRESENTATION_PARAMS
{
uint32 windowWidth;
uint32 windowHeight;
PRESENTATION_MODE mode;
};
CGSH_OpenGL();
virtual ~CGSH_OpenGL();
virtual void LoadState(Framework::CZipArchiveReader&);
void SetPresentationParams(const PRESENTATION_PARAMS&);
void ProcessImageTransfer(uint32, uint32);
void ProcessClutTransfer(uint32, uint32);
void ReadFramebuffer(uint32, uint32, void*);
@ -36,7 +51,6 @@ protected:
virtual void InitializeImpl();
virtual void ReleaseImpl();
virtual void FlipImpl();
virtual void SetViewport(int, int);
private:
struct RENDERSTATE
@ -201,6 +215,8 @@ private:
template <uint32> void TexUploader_Psm4H(const TEX0&, const TEXA&);
void TexUploader_Psm8H(const TEX0&, const TEXA&);
PRESENTATION_PARAMS m_presentationParams;
//Context variables (put this in a struct or something?)
float m_nPrimOfsX;
float m_nPrimOfsY;
@ -208,8 +224,8 @@ private:
uint32 m_nTexHeight;
float m_nMaxZ;
int m_nWidth;
int m_nHeight;
int m_displayWidth;
int m_displayHeight;
bool m_nLinesAsQuads;
bool m_nForceBilinearTextures;

File diff suppressed because it is too large Load Diff

View File

@ -19,10 +19,10 @@
#include "VirtualMachine.h"
#include "MipsExecutor.h"
#include "MA_VU.h"
#include "MA_EE.h"
#include "COP_SCU.h"
#include "COP_FPU.h"
#include "COP_VU.h"
#include "MA_EE.h"
#include "COP_SCU.h"
#include "COP_FPU.h"
#include "COP_VU.h"
#include "iop/Iop_SubSystem.h"
#include "PS2OS.h"
@ -103,8 +103,8 @@ public:
uint32 Vu1IoPortReadHandler(uint32);
uint32 Vu1IoPortWriteHandler(uint32, uint32);
CGSHandler* m_pGS;
CPadHandler* m_pPad;
CGSHandler* m_gs;
CPadHandler* m_pad;
Iop::CSubSystem m_iop;

View File

@ -1,16 +1,24 @@
#import <Cocoa/Cocoa.h>
#import "OutputWindowController.h"
#import "GSH_OpenGLMacOSX.h"
@interface ApplicationDelegate : NSObject
@interface ApplicationDelegate : NSObject<OutputWindowDelegate>
{
OutputWindowController* outputWindowController;
IBOutlet NSMenuItem* pauseResumeMenuItem;
OutputWindowController* outputWindowController;
IBOutlet NSMenuItem* pauseResumeMenuItem;
IBOutlet NSMenuItem* loadStateMenuItem;
IBOutlet NSMenuItem* saveStateMenuItem;
CGSH_OpenGL::PRESENTATION_MODE presentationMode;
}
-(void)applicationDidFinishLaunching: (NSNotification*)notification;
-(IBAction)bootElfMenuSelected: (id)sender;
-(IBAction)bootCdrom0MenuSelected: (id)sender;
-(IBAction)bootDiskImageSelected: (id)sender;
-(IBAction)bootDiskImageMenuSelected: (id)sender;
-(IBAction)fitToScreenMenuSelected: (id)sender;
-(IBAction)fillScreenMenuSelected: (id)sender;
-(IBAction)actualSizeMenuSelected: (id)sender;
-(IBAction)fullScreenMenuSelected: (id)sender;
-(IBAction)pauseResumeMenuSelected: (id)sender;
-(IBAction)saveStateMenuSelected: (id)sender;
-(IBAction)loadStateMenuSelected: (id)sender;

View File

@ -7,16 +7,23 @@
#import "../PS2VM_Preferences.h"
#import "../AppConfig.h"
#define PREFERENCE_RENDERER_PRESENTATION_MODE "renderer.presentationmode"
@implementation ApplicationDelegate
-(void)applicationDidFinishLaunching: (NSNotification*)notification
{
CAppConfig::GetInstance().RegisterPreferenceInteger(PREFERENCE_RENDERER_PRESENTATION_MODE, CGSH_OpenGL::PRESENTATION_MODE_FIT);
presentationMode = static_cast<CGSH_OpenGL::PRESENTATION_MODE>(CAppConfig::GetInstance().GetPreferenceInteger(PREFERENCE_RENDERER_PRESENTATION_MODE));
g_virtualMachine->Initialize();
outputWindowController = [[OutputWindowController alloc] initWithWindowNibName: @"OutputWindow"];
[outputWindowController.window setContentSize: NSMakeSize(640.0, 448.0)];
[outputWindowController.window center];
[outputWindowController showWindow: nil];
[outputWindowController setDelegate: self];
NSOpenGLContext* context = [outputWindowController.openGlView openGLContext];
void* lowLevelContext = [context CGLContextObj];
@ -39,6 +46,16 @@
#endif
}
-(void)applicationDidBecomeActive: (NSNotification*)notification
{
[self updatePresentationParams];
}
-(void)outputWindowDidResize: (NSSize)size
{
[self updatePresentationParams];
}
-(void)applicationWillTerminate: (NSNotification*)notification
{
g_virtualMachine->Pause();
@ -59,7 +76,7 @@
[self bootFromElf: filePath];
}
-(IBAction)bootDiskImageSelected: (id)sender
-(IBAction)bootDiskImageMenuSelected: (id)sender
{
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
NSArray* fileTypes = [NSArray arrayWithObjects: @"iso", @"isz", nil];
@ -81,7 +98,33 @@
[self bootFromCdrom0];
}
-(void)pauseResumeMenuSelected: (id)sender
-(IBAction)fitToScreenMenuSelected: (id)sender
{
presentationMode = CGSH_OpenGL::PRESENTATION_MODE_FIT;
CAppConfig::GetInstance().SetPreferenceInteger(PREFERENCE_RENDERER_PRESENTATION_MODE, presentationMode);
[self updatePresentationParams];
}
-(IBAction)fillScreenMenuSelected: (id)sender
{
presentationMode = CGSH_OpenGL::PRESENTATION_MODE_FILL;
CAppConfig::GetInstance().SetPreferenceInteger(PREFERENCE_RENDERER_PRESENTATION_MODE, presentationMode);
[self updatePresentationParams];
}
-(IBAction)actualSizeMenuSelected: (id)sender
{
presentationMode = CGSH_OpenGL::PRESENTATION_MODE_ORIGINAL;
CAppConfig::GetInstance().SetPreferenceInteger(PREFERENCE_RENDERER_PRESENTATION_MODE, presentationMode);
[self updatePresentationParams];
}
-(IBAction)fullScreenMenuSelected: (id)sender
{
[outputWindowController.window toggleFullScreen: nil];
}
-(IBAction)pauseResumeMenuSelected: (id)sender
{
if(g_virtualMachine->GetStatus() == CVirtualMachine::RUNNING)
{
@ -93,12 +136,12 @@
}
}
-(void)saveStateMenuSelected: (id)sender
-(IBAction)saveStateMenuSelected: (id)sender
{
g_virtualMachine->SaveState("state.st0.zip");
}
-(void)loadStateMenuSelected: (id)sender
-(IBAction)loadStateMenuSelected: (id)sender
{
if(g_virtualMachine->LoadState("state.st0.zip"))
{
@ -106,7 +149,7 @@
}
}
-(void)vfsManagerMenuSelected: (id)sender
-(IBAction)vfsManagerMenuSelected: (id)sender
{
[[VfsManagerController defaultController] showManager];
}
@ -147,11 +190,39 @@
-(BOOL)validateUserInterfaceItem: (id<NSValidatedUserInterfaceItem>)item
{
if(item == pauseResumeMenuItem)
bool hasElf = g_virtualMachine->m_os->GetELF() != NULL;
if(
item == pauseResumeMenuItem ||
item == loadStateMenuItem ||
item == saveStateMenuItem)
{
return g_virtualMachine->m_os->GetELF() != NULL;
return hasElf;
}
if(item.action == @selector(fitToScreenMenuSelected:))
{
[(NSMenuItem*)item setState: (presentationMode == CGSH_OpenGL::PRESENTATION_MODE_FIT) ? NSOnState : NSOffState];
}
if(item.action == @selector(fillScreenMenuSelected:))
{
[(NSMenuItem*)item setState: (presentationMode == CGSH_OpenGL::PRESENTATION_MODE_FILL) ? NSOnState : NSOffState];
}
if(item.action == @selector(actualSizeMenuSelected:))
{
[(NSMenuItem*)item setState: (presentationMode == CGSH_OpenGL::PRESENTATION_MODE_ORIGINAL) ? NSOnState : NSOffState];
}
return YES;
}
-(void)updatePresentationParams
{
NSSize contentSize = [outputWindowController contentSize];
auto gs = static_cast<CGSH_OpenGLMacOSX*>(g_virtualMachine->m_gs);
CGSH_OpenGL::PRESENTATION_PARAMS presentationParams;
presentationParams.windowWidth = static_cast<unsigned int>(contentSize.width);
presentationParams.windowHeight = static_cast<unsigned int>(contentSize.height);
presentationParams.mode = presentationMode;
gs->SetPresentationParams(presentationParams);
gs->Flip();
}
@end

View File

@ -609,23 +609,52 @@
<object class="NSMenu" key="NSSubmenu" id="466310130">
<string key="NSTitle">View</string>
<array class="NSMutableArray" key="NSMenuItems">
<object class="NSMenuItem" id="102151532">
<object class="NSMenuItem" id="93006691">
<reference key="NSMenu" ref="466310130"/>
<string key="NSTitle">Show Toolbar</string>
<string key="NSKeyEquiv">t</string>
<int key="NSKeyEquivModMask">1572864</int>
<string key="NSTitle">Fit To Screen</string>
<string key="NSKeyEquiv">1</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="229763992"/>
<reference key="NSMixedImage" ref="909111550"/>
</object>
<object class="NSMenuItem" id="237841660">
<object class="NSMenuItem" id="826066268">
<reference key="NSMenu" ref="466310130"/>
<string key="NSTitle">Customize Toolbar…</string>
<string key="NSTitle">Fill Screen</string>
<string key="NSKeyEquiv">2</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="229763992"/>
<reference key="NSMixedImage" ref="909111550"/>
</object>
<object class="NSMenuItem" id="724003774">
<reference key="NSMenu" ref="466310130"/>
<string key="NSTitle">Actual Size</string>
<string key="NSKeyEquiv">3</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="229763992"/>
<reference key="NSMixedImage" ref="909111550"/>
</object>
<object class="NSMenuItem" id="155928744">
<reference key="NSMenu" ref="466310130"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsSeparator">YES</bool>
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="229763992"/>
<reference key="NSMixedImage" ref="909111550"/>
</object>
<object class="NSMenuItem" id="83488267">
<reference key="NSMenu" ref="466310130"/>
<string key="NSTitle">Full Screen</string>
<string key="NSKeyEquiv">F</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="229763992"/>
<reference key="NSMixedImage" ref="909111550"/>
</object>
</array>
</object>
</object>
@ -814,22 +843,6 @@
</object>
<int key="connectionID">360</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">runToolbarCustomizationPalette:</string>
<reference key="source" ref="1014"/>
<reference key="destination" ref="237841660"/>
</object>
<int key="connectionID">365</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">toggleToolbarShown:</string>
<reference key="source" ref="1014"/>
<reference key="destination" ref="102151532"/>
</object>
<int key="connectionID">366</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">hide:</string>
@ -1158,14 +1171,6 @@
</object>
<int key="connectionID">826</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">bootDiskImageSelected:</string>
<reference key="source" ref="1011167885"/>
<reference key="destination" ref="1069642038"/>
</object>
<int key="connectionID">827</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">pauseResumeMenuItem</string>
@ -1174,6 +1179,62 @@
</object>
<int key="connectionID">828</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">loadStateMenuItem</string>
<reference key="source" ref="1011167885"/>
<reference key="destination" ref="633737104"/>
</object>
<int key="connectionID">829</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">saveStateMenuItem</string>
<reference key="source" ref="1011167885"/>
<reference key="destination" ref="146685118"/>
</object>
<int key="connectionID">830</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">fullScreenMenuSelected:</string>
<reference key="source" ref="1011167885"/>
<reference key="destination" ref="83488267"/>
</object>
<int key="connectionID">836</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">bootDiskImageMenuSelected:</string>
<reference key="source" ref="1011167885"/>
<reference key="destination" ref="1069642038"/>
</object>
<int key="connectionID">837</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">fitToScreenMenuSelected:</string>
<reference key="source" ref="1011167885"/>
<reference key="destination" ref="93006691"/>
</object>
<int key="connectionID">838</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">fillScreenMenuSelected:</string>
<reference key="source" ref="1011167885"/>
<reference key="destination" ref="826066268"/>
</object>
<int key="connectionID">839</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">actualSizeMenuSelected:</string>
<reference key="source" ref="1011167885"/>
<reference key="destination" ref="724003774"/>
</object>
<int key="connectionID">840</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@ -1714,21 +1775,14 @@
<int key="objectID">296</int>
<reference key="object" ref="466310130"/>
<array class="NSMutableArray" key="children">
<reference ref="102151532"/>
<reference ref="237841660"/>
<reference ref="93006691"/>
<reference ref="826066268"/>
<reference ref="724003774"/>
<reference ref="155928744"/>
<reference ref="83488267"/>
</array>
<reference key="parent" ref="586577488"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">298</int>
<reference key="object" ref="237841660"/>
<reference key="parent" ref="466310130"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">297</int>
<reference key="object" ref="102151532"/>
<reference key="parent" ref="466310130"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">802</int>
<reference key="object" ref="1069642038"/>
@ -1784,6 +1838,31 @@
<reference key="object" ref="1006695130"/>
<reference key="parent" ref="665038911"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">831</int>
<reference key="object" ref="93006691"/>
<reference key="parent" ref="466310130"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">832</int>
<reference key="object" ref="826066268"/>
<reference key="parent" ref="466310130"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">833</int>
<reference key="object" ref="724003774"/>
<reference key="parent" ref="466310130"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">834</int>
<reference key="object" ref="155928744"/>
<reference key="parent" ref="466310130"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">835</int>
<reference key="object" ref="83488267"/>
<reference key="parent" ref="466310130"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@ -1811,8 +1890,6 @@
<string key="29.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="295.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="296.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="297.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="298.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="371.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="56.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
@ -1878,13 +1955,18 @@
<string key="821.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="822.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="83.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="831.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="832.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="833.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="834.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="835.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="92.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">828</int>
<int key="maxID">840</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -1893,8 +1975,9 @@
<string key="superclassName">NSObject</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="bootCdrom0MenuSelected:">id</string>
<string key="bootDiskImageSelected:">id</string>
<string key="bootDiskImageMenuSelected:">id</string>
<string key="bootElfMenuSelected:">id</string>
<string key="fullScreenMenuSelected:">id</string>
<string key="loadStateMenuSelected:">id</string>
<string key="pauseResumeMenuSelected:">id</string>
<string key="saveStateMenuSelected:">id</string>
@ -1905,14 +1988,18 @@
<string key="name">bootCdrom0MenuSelected:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="bootDiskImageSelected:">
<string key="name">bootDiskImageSelected:</string>
<object class="IBActionInfo" key="bootDiskImageMenuSelected:">
<string key="name">bootDiskImageMenuSelected:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="bootElfMenuSelected:">
<string key="name">bootElfMenuSelected:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="fullScreenMenuSelected:">
<string key="name">fullScreenMenuSelected:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="loadStateMenuSelected:">
<string key="name">loadStateMenuSelected:</string>
<string key="candidateClassName">id</string>
@ -1930,17 +2017,25 @@
<string key="candidateClassName">id</string>
</object>
</dictionary>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">pauseResumeMenuItem</string>
<string key="NS.object.0">NSMenuItem</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">pauseResumeMenuItem</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<dictionary class="NSMutableDictionary" key="outlets">
<string key="loadStateMenuItem">NSMenuItem</string>
<string key="pauseResumeMenuItem">NSMenuItem</string>
<string key="saveStateMenuItem">NSMenuItem</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="loadStateMenuItem">
<string key="name">loadStateMenuItem</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo" key="pauseResumeMenuItem">
<string key="name">pauseResumeMenuItem</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
</object>
<object class="IBToOneOutletInfo" key="saveStateMenuItem">
<string key="name">saveStateMenuItem</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/ApplicationDelegate.h</string>

View File

@ -35,7 +35,7 @@
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="1005">
<int key="NSWindowStyleMask">1</int>
<int key="NSWindowStyleMask">9</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{196, 240}, {659, 413}}</string>
<int key="NSWTFlags">544735232</int>
@ -68,6 +68,8 @@
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<string key="NSFrameAutosaveName"/>
<int key="NSWindowCollectionBehavior">128</int>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
</array>
@ -89,6 +91,14 @@
</object>
<int key="connectionID">31</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="1005"/>
<reference key="destination" ref="1001"/>
</object>
<int key="connectionID">32</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@ -248,7 +258,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">31</int>
<int key="maxID">32</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">

View File

@ -2,8 +2,8 @@
#include "CoreFoundation/CoreFoundation.h"
#include "StdStream.h"
CGSH_OpenGLMacOSX::CGSH_OpenGLMacOSX(CGLContextObj context) :
m_context(context)
CGSH_OpenGLMacOSX::CGSH_OpenGLMacOSX(CGLContextObj context)
: m_context(context)
{
}

View File

@ -1,10 +1,20 @@
#import <Cocoa/Cocoa.h>
@protocol OutputWindowDelegate
-(void)outputWindowDidResize: (NSSize)size;
@end
@interface OutputWindowController : NSWindowController
{
NSOpenGLView* _openGlView;
NSOpenGLView* _openGlView;
id<OutputWindowDelegate> _delegate;
}
@property(assign, nonatomic) IBOutlet NSOpenGLView* openGlView;
-(void)setDelegate: (id<OutputWindowDelegate>)delegate;
-(NSSize)contentSize;
@end

View File

@ -8,4 +8,31 @@
@synthesize openGlView = _openGlView;
-(void)setDelegate: (id)delegate
{
_delegate = delegate;
}
-(NSApplicationPresentationOptions)window: (NSWindow*)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions
{
return (NSApplicationPresentationFullScreen | NSApplicationPresentationHideDock | NSApplicationPresentationAutoHideMenuBar);
}
-(NSSize)window: (NSWindow*)window willUseFullScreenContentSize: (NSSize)proposedSize
{
return proposedSize;
}
-(void)windowDidResize: (NSNotification*)notification
{
[_delegate outputWindowDidResize: [self contentSize]];
}
-(NSSize)contentSize
{
NSView* contentView = self.window.contentView;
NSRect contentFrame = contentView.frame;
return contentFrame.size;
}
@end

View File

@ -1239,7 +1239,10 @@
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ../Source/macosxui/Purei_Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = _IOP_EMULATE_MODULES;
GCC_PREPROCESSOR_DEFINITIONS = (
_IOP_EMULATE_MODULES,
NDEBUG,
);
HEADER_SEARCH_PATHS = (
"~/Libraries/boost_1_50_0",
"~/Projects/Framework/include",