Version 1.17
+ Code::Blocks Full Screen Support
This commit is contained in:
parent
570e2cf84b
commit
04af4f42da
@ -2,7 +2,7 @@
|
|||||||
olcPixelGameEngine.h
|
olcPixelGameEngine.h
|
||||||
|
|
||||||
+-------------------------------------------------------------+
|
+-------------------------------------------------------------+
|
||||||
| OneLoneCoder Pixel Game Engine v1.16 |
|
| OneLoneCoder Pixel Game Engine v1.17 |
|
||||||
| "Like the command prompt console one, but not..." - javidx9 |
|
| "Like the command prompt console one, but not..." - javidx9 |
|
||||||
+-------------------------------------------------------------+
|
+-------------------------------------------------------------+
|
||||||
|
|
||||||
@ -126,6 +126,7 @@
|
|||||||
Special thanks to those who bring gifts!
|
Special thanks to those who bring gifts!
|
||||||
GnarGnarHead.......Domina
|
GnarGnarHead.......Domina
|
||||||
Gorbit99...........Bastion, Ori & The Blind Forest
|
Gorbit99...........Bastion, Ori & The Blind Forest
|
||||||
|
Marti Morta........Gris
|
||||||
|
|
||||||
Special thanks to my Patreons too - I wont name you on here, but I've
|
Special thanks to my Patreons too - I wont name you on here, but I've
|
||||||
certainly enjoyed my tea and flapjacks :D
|
certainly enjoyed my tea and flapjacks :D
|
||||||
@ -185,6 +186,13 @@
|
|||||||
#else
|
#else
|
||||||
// In Code::Blocks, Select C++14 in your build options, and add the
|
// In Code::Blocks, Select C++14 in your build options, and add the
|
||||||
// following libs to your linker: user32 gdi32 opengl32 gdiplus
|
// following libs to your linker: user32 gdi32 opengl32 gdiplus
|
||||||
|
#if !defined _WIN32_WINNT
|
||||||
|
#ifdef HAVE_MSMF
|
||||||
|
#define _WIN32_WINNT 0x0600 // Windows Vista
|
||||||
|
#else
|
||||||
|
#define _WIN32_WINNT 0x0500 // Windows 2000
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
// Include WinAPI
|
// Include WinAPI
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -280,10 +288,10 @@ namespace olc // All OneLoneCoder stuff will now exist in the "olc" namespace
|
|||||||
inline v2d_generic perp() { return v2d_generic(-y, x); }
|
inline v2d_generic perp() { return v2d_generic(-y, x); }
|
||||||
inline T dot(const v2d_generic& rhs) { return this->x * rhs.x + this->y * rhs.y; }
|
inline T dot(const v2d_generic& rhs) { return this->x * rhs.x + this->y * rhs.y; }
|
||||||
inline T cross(const v2d_generic& rhs) { return this->x * rhs.y - this->y * rhs.x; }
|
inline T cross(const v2d_generic& rhs) { return this->x * rhs.y - this->y * rhs.x; }
|
||||||
inline v2d_generic operator + (const v2d_generic& rhs) { return v2d_generic(this->x + rhs.x, this->y + rhs.y);}
|
inline v2d_generic operator + (const v2d_generic& rhs) const { return v2d_generic(this->x + rhs.x, this->y + rhs.y);}
|
||||||
inline v2d_generic operator - (const v2d_generic& rhs) { return v2d_generic(this->x - rhs.x, this->y - rhs.y);}
|
inline v2d_generic operator - (const v2d_generic& rhs) const { return v2d_generic(this->x - rhs.x, this->y - rhs.y);}
|
||||||
inline v2d_generic operator * (const T& rhs) { return v2d_generic(this->x * rhs, this->y * rhs); }
|
inline v2d_generic operator * (const T& rhs) const { return v2d_generic(this->x * rhs, this->y * rhs); }
|
||||||
inline v2d_generic operator / (const T& rhs) { return v2d_generic(this->x / rhs, this->y / rhs); }
|
inline v2d_generic operator / (const T& rhs) const { return v2d_generic(this->x / rhs, this->y / rhs); }
|
||||||
inline v2d_generic& operator += (const v2d_generic& rhs) { this->x += rhs.x; this->y += rhs.y; return *this; }
|
inline v2d_generic& operator += (const v2d_generic& rhs) { this->x += rhs.x; this->y += rhs.y; return *this; }
|
||||||
inline v2d_generic& operator -= (const v2d_generic& rhs) { this->x -= rhs.x; this->y -= rhs.y; return *this; }
|
inline v2d_generic& operator -= (const v2d_generic& rhs) { this->x -= rhs.x; this->y -= rhs.y; return *this; }
|
||||||
inline v2d_generic& operator *= (const T& rhs) { this->x *= rhs; this->y *= rhs; return *this; }
|
inline v2d_generic& operator *= (const T& rhs) { this->x *= rhs; this->y *= rhs; return *this; }
|
||||||
@ -1668,13 +1676,13 @@ namespace olc
|
|||||||
int32_t wh = nScreenHeight * nPixelHeight;
|
int32_t wh = nScreenHeight * nPixelHeight;
|
||||||
float wasp = (float)ww / (float)wh;
|
float wasp = (float)ww / (float)wh;
|
||||||
|
|
||||||
nViewW = nWindowWidth;
|
nViewW = (int32_t)nWindowWidth;
|
||||||
nViewH = (float)nViewW / wasp;
|
nViewH = (int32_t)((float)nViewW / wasp);
|
||||||
|
|
||||||
if (nViewH > nWindowHeight)
|
if (nViewH > nWindowHeight)
|
||||||
{
|
{
|
||||||
nViewH = nWindowHeight;
|
nViewH = nWindowHeight;
|
||||||
nViewW = (float)nViewH * wasp;
|
nViewW = (int32_t)((float)nViewH * wasp);
|
||||||
}
|
}
|
||||||
|
|
||||||
nViewX = (nWindowWidth - nViewW) / 2;
|
nViewX = (nWindowWidth - nViewW) / 2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user