Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions dev/msvc/olcPGE3_BuildSH/olcPGE3_BuildSH.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\examples\olcPGE3_Mouse.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\examples\olcPGE3_PixelShaders.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
Expand All @@ -108,8 +108,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\examples\olcPGE3_SoftwareRendering.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\examples\olcPGE3_TextFontMap.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
Expand Down
26 changes: 23 additions & 3 deletions dev/src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,17 @@ namespace olc
//pRenderer->RetargetDevice(pHost->GetHostWindowDescriptor(this));
pRenderer->PrepareWindowTarget(pHost->GetHostWindowDescriptor(this));
CreateImage(GetScreen(), vScreenSize);
SetWindowSize(vScreenSize * vPixelSize);

olc::vi2d vPS = vPixelSize;
if (config.bRealWindow)
vPS = { 1,1 };


SetWindowSize(vScreenSize * vPS);

// Assume 1:1 Relationship for now
vViewPos = { 0,0 };
vViewSize = vScreenSize * vPixelSize;
vViewSize = vScreenSize * vPS;
return true;
}

Expand Down Expand Up @@ -383,6 +389,16 @@ namespace olc
return true;
}

bool PGEWindow::olc_OnWindowSize(const olc::vi2d& vSize)
{
if (config.bRealWindow)
{
GetScreen().Resize(vSize);
}

return SetWindowSize(vSize);
}




Expand All @@ -407,8 +423,12 @@ namespace olc
bool PixelGameEngine::Construct(const PGEConfig& cfg)
{
config = cfg;

if (config.bRealWindow)
config.vPixelSize = { 1,1 };

// Also assign the window level config since that is what the Host will see
Window::config = cfg;
Window::config = config;

// Check for constructor sAppName, if not set use Config sAppName
if (sAppName.empty())
Expand Down
1 change: 1 addition & 0 deletions dev/src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ namespace olc
protected:
bool olc_OnMouseMove(const olc::vi2d& vMousePos) override;
bool olc_OnTouch(const uint32_t nID, const olc::vf2d& vPos, const bool bPress, const bool bRelease, const olc::vf2d& vSize, const bool stylus = false, const float pressure = 0.0f, const float orientation = 0, const olc::vf2d& tilt = { 0,0 }) override;
bool olc_OnWindowSize(const olc::vi2d& vSize) override;

public:
virtual bool olc_WindowUpdate(const float fElapsedTime, const float fTotalElapsedTime);
Expand Down
27 changes: 24 additions & 3 deletions olcPixelGameEngine3.h
Original file line number Diff line number Diff line change
Expand Up @@ -4426,6 +4426,7 @@ namespace olc
protected:
bool olc_OnMouseMove(const olc::vi2d& vMousePos) override;
bool olc_OnTouch(const uint32_t nID, const olc::vf2d& vPos, const bool bPress, const bool bRelease, const olc::vf2d& vSize, const bool stylus = false, const float pressure = 0.0f, const float orientation = 0, const olc::vf2d& tilt = { 0,0 }) override;
bool olc_OnWindowSize(const olc::vi2d& vSize) override;

public:
virtual bool olc_WindowUpdate(const float fElapsedTime, const float fTotalElapsedTime);
Expand Down Expand Up @@ -19971,11 +19972,17 @@ namespace olc
//pRenderer->RetargetDevice(pHost->GetHostWindowDescriptor(this));
pRenderer->PrepareWindowTarget(pHost->GetHostWindowDescriptor(this));
CreateImage(GetScreen(), vScreenSize);
SetWindowSize(vScreenSize * vPixelSize);

olc::vi2d vPS = vPixelSize;
if (config.bRealWindow)
vPS = { 1,1 };


SetWindowSize(vScreenSize * vPS);

// Assume 1:1 Relationship for now
vViewPos = { 0,0 };
vViewSize = vScreenSize * vPixelSize;
vViewSize = vScreenSize * vPS;
return true;
}

Expand Down Expand Up @@ -20277,6 +20284,16 @@ namespace olc
return true;
}

bool PGEWindow::olc_OnWindowSize(const olc::vi2d& vSize)
{
if (config.bRealWindow)
{
GetScreen().Resize(vSize);
}

return SetWindowSize(vSize);
}




Expand All @@ -20301,8 +20318,12 @@ namespace olc
bool PixelGameEngine::Construct(const PGEConfig& cfg)
{
config = cfg;

if (config.bRealWindow)
config.vPixelSize = { 1,1 };

// Also assign the window level config since that is what the Host will see
Window::config = cfg;
Window::config = config;

// Check for constructor sAppName, if not set use Config sAppName
if (sAppName.empty())
Expand Down
Loading