Update olcPixelGameEngine.h
This commit is contained in:
@@ -2,51 +2,10 @@
|
|||||||
olcPixelGameEngine.h
|
olcPixelGameEngine.h
|
||||||
|
|
||||||
+-------------------------------------------------------------+
|
+-------------------------------------------------------------+
|
||||||
| OneLoneCoder Pixel Game Engine v1.13 |
|
| Unofficial Pixel Game Engine v1.13 |
|
||||||
| "Like the command prompt console one, but not..." - javidx9 |
|
| "Like the command prompt console one, but not..." - javidx9 |
|
||||||
+-------------------------------------------------------------+
|
+-------------------------------------------------------------+
|
||||||
|
|
||||||
What is this?
|
|
||||||
~~~~~~~~~~~~~
|
|
||||||
The olcConsoleGameEngine has been a surprsing and wonderful
|
|
||||||
success for me, and I'm delighted how people have reacted so
|
|
||||||
positively towards it, so thanks for that.
|
|
||||||
|
|
||||||
However, there are limitations that I simply cannot avoid.
|
|
||||||
Firstly, I need to maintain several different versions of
|
|
||||||
it to accommodate users on Windows7, 8, 10, Linux, Mac,
|
|
||||||
Visual Studio & Code::Blocks. Secondly, this year I've been
|
|
||||||
pushing the console to the limits of its graphical capabilities
|
|
||||||
and the effect is becoming underwhelming. The engine itself
|
|
||||||
is not slow at all, but the process that Windows uses to
|
|
||||||
draw the command prompt to the screen is, and worse still,
|
|
||||||
it's dynamic based upon the variation of character colours
|
|
||||||
and glyphs. Sadly I have no control over this, and recent
|
|
||||||
videos that are extremely graphical (for a command prompt :P )
|
|
||||||
have been dipping to unacceptable framerates. As the channel
|
|
||||||
has been popular with aspiring game developers, I'm concerned
|
|
||||||
that the visual appeal of the command prompt is perhaps
|
|
||||||
limited to us oldies, and I dont want to alienate younger
|
|
||||||
learners. Finally, I'd like to demonstrate many more
|
|
||||||
algorithms and image processing that exist in the graphical
|
|
||||||
domain, for which the console is insufficient.
|
|
||||||
|
|
||||||
For this reason, I have created olcPixelGameEngine! The look
|
|
||||||
and feel to the programmer is almost identical, so all of my
|
|
||||||
existing code from the videos is easily portable, and the
|
|
||||||
programmer uses this file in exactly the same way. But I've
|
|
||||||
decided that rather than just build a command prompt emulator,
|
|
||||||
that I would at least harness some modern(ish) portable
|
|
||||||
technologies.
|
|
||||||
|
|
||||||
As a result, the olcPixelGameEngine supports 32-bit colour, is
|
|
||||||
written in a cross-platform style, uses modern(ish) C++
|
|
||||||
conventions and most importantly, renders much much faster. I
|
|
||||||
will use this version when my applications are predominantly
|
|
||||||
graphics based, but use the console version when they are
|
|
||||||
predominantly text based - Don't worry, loads more command
|
|
||||||
prompt silliness to come yet, but evolution is important!!
|
|
||||||
|
|
||||||
License (OLC-3)
|
License (OLC-3)
|
||||||
~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@@ -79,21 +38,7 @@
|
|||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
Links
|
|
||||||
~~~~~
|
|
||||||
YouTube: https://www.youtube.com/javidx9
|
|
||||||
Discord: https://discord.gg/WhwHUMV
|
|
||||||
Twitter: https://www.twitter.com/javidx9
|
|
||||||
Twitch: https://www.twitch.tv/javidx9
|
|
||||||
GitHub: https://www.github.com/onelonecoder
|
|
||||||
Homepage: https://www.onelonecoder.com
|
|
||||||
Patreon: https://www.patreon.com/javidx9
|
|
||||||
|
|
||||||
Relevant Videos
|
|
||||||
~~~~~~~~~~~~~~~
|
|
||||||
https://youtu.be/kRH6oJLFYxY Introducing olcPixelGameEngine
|
|
||||||
|
|
||||||
Compiling in Linux
|
Compiling in Linux
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
You will need a modern C++ compiler, so update yours!
|
You will need a modern C++ compiler, so update yours!
|
||||||
@@ -107,15 +52,6 @@
|
|||||||
|
|
||||||
vblank_mode=0 ./YourProgName
|
vblank_mode=0 ./YourProgName
|
||||||
|
|
||||||
|
|
||||||
Compiling in Code::Blocks on Windows
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
Well I wont judge you, but make sure your Code::Blocks installation
|
|
||||||
is really up to date - you may even consider updating your C++ toolchain
|
|
||||||
to use MinGW32-W64, so google this. You will also need to enable C++14
|
|
||||||
in your build options, and add to your linker the following libraries:
|
|
||||||
user32 gdi32 opengl32 gdiplus
|
|
||||||
|
|
||||||
Thanks
|
Thanks
|
||||||
~~~~~~
|
~~~~~~
|
||||||
I'd like to extend thanks to Eremiell, slavka, gurkanctn, Phantim,
|
I'd like to extend thanks to Eremiell, slavka, gurkanctn, Phantim,
|
||||||
@@ -134,43 +70,7 @@
|
|||||||
Author
|
Author
|
||||||
~~~~~~
|
~~~~~~
|
||||||
David Barr, aka javidx9, <20>OneLoneCoder 2018, 2019
|
David Barr, aka javidx9, <20>OneLoneCoder 2018, 2019
|
||||||
*/
|
Ben (plane000)#8618
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
/* Example Usage (main.cpp)
|
|
||||||
#define OLC_PGE_APPLICATION
|
|
||||||
#include "olcPixelGameEngine.h"
|
|
||||||
// Override base class with your custom functionality
|
|
||||||
class Example : public olc::PixelGameEngine
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Example()
|
|
||||||
{
|
|
||||||
sAppName = "Example";
|
|
||||||
}
|
|
||||||
public:
|
|
||||||
bool OnUserCreate() override
|
|
||||||
{
|
|
||||||
// Called once at the start, so create things here
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
bool OnUserUpdate(float fElapsedTime) override
|
|
||||||
{
|
|
||||||
// called once per frame, draws random coloured pixels
|
|
||||||
for (int x = 0; x < ScreenWidth(); x++)
|
|
||||||
for (int y = 0; y < ScreenHeight(); y++)
|
|
||||||
Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
Example demo;
|
|
||||||
if (demo.Construct(256, 240, 4, 4))
|
|
||||||
demo.Start();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef OLC_PGE_DEF
|
#ifndef OLC_PGE_DEF
|
||||||
|
|||||||
Reference in New Issue
Block a user