Added NOMINMAX before windows.h

pull/113/head
Javidx9 6 years ago committed by GitHub
parent f8e2028ac5
commit f7dd45da7d
  1. 3
      OneLoneCoder_PGE_Balls2.cpp
  2. 3
      olcPixelGameEngine.h

@ -35,6 +35,7 @@ Last Updated: 18/02/2017
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <algorithm>
using namespace std; using namespace std;
#include "olcPixelGameEngine.h" #include "olcPixelGameEngine.h"
@ -287,7 +288,7 @@ public:
// how much of the segment is in the "shadow" of the object vector. The min and max clamp // how much of the segment is in the "shadow" of the object vector. The min and max clamp
// this to lie between 0 and the line segment length, which is then normalised. We can // this to lie between 0 and the line segment length, which is then normalised. We can
// use this to calculate the closest point on the line segment // use this to calculate the closest point on the line segment
float t = max(0, min(fEdgeLength, (fLineX1 * fLineX2 + fLineY1 * fLineY2))) / fEdgeLength; float t = std::max(0.0f, std::min(fEdgeLength, (fLineX1 * fLineX2 + fLineY1 * fLineY2))) / fEdgeLength;
// Which we do here // Which we do here
float fClosestPointX = edge.sx + t * fLineX1; float fClosestPointX = edge.sx + t * fLineX1;

@ -2,7 +2,7 @@
olcPixelGameEngine.h olcPixelGameEngine.h
+-------------------------------------------------------------+ +-------------------------------------------------------------+
| OneLoneCoder Pixel Game Engine v0.3 | | OneLoneCoder Pixel Game Engine v0.4 |
| "Like the command prompt console one, but not..." - javidx9 | | "Like the command prompt console one, but not..." - javidx9 |
+-------------------------------------------------------------+ +-------------------------------------------------------------+
@ -143,6 +143,7 @@
// Include WinAPI // Include WinAPI
#define NOMINMAX
#include <windows.h> #include <windows.h>
#include <gdiplus.h> #include <gdiplus.h>

Loading…
Cancel
Save