The official distribution of olcPixelGameEngine, a tool used in javidx9's YouTube videos and projects

olcPixelGameEngine

The official distribution of olcPixelGameEngine, a tool used in javidx9's YouTube videos and projects.

You only need the one file - olcPixelGameEngine.h - included in your project!

Provides a fast, richly featured, cross platform pixel drawing and user interface framework for

  • The development of games
  • Visualisation of algorithms
  • Prototyping and experimentation
  • Education

olcPixelGameEngine is easily extended! for example:

  • 2D Affine transforms
  • 3D Software renderer
  • Controller input
  • Sound
  • Hardware interfaces

olcPixelGameEngine is easy to port! Runs on:

  • Windows (all)
  • Linux / Raspberry Pi / ChromeOS
  • MacOS (coming soon to official, but already available in "Contributors")
  • PSP & Switch (Not supported by OneLoneCoder)

olcPixelGameEngine has been reimplemented in other languages!

  • C#
  • Rust
  • Lua
  • Java

olcPixelGameEngine is actively maintained and developed!

olcPixelGameEngine is used by 100s, if not 1000s of programmers at all levels of ability!

Documentation

Please see https://github.com/OneLoneCoder/olcPixelGameEngine/wiki

License (OLC-3)

Copyright 2018, 2019, 2020, 2021 OneLoneCoder.com

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions or derivations of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions or derivative works in binary form must reproduce the above copyright notice. This list of conditions and the following disclaimer must be reproduced in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Owner
Javidx9
I'm a programmer. I'm keen on getting the word out that programming is fun, silly and educational. I don't do much web stuff, I like clock cycles.
Javidx9
Comments
  • Wiki-Entry

    Wiki-Entry "Compiling on Linux"

    It took me some time to figure out how to compile the olcPGE example on Linux. The following code may be a good start for the corresponding wiki page:

    The following dependencies must be installed including the development files using your packet manager:

    • glew: Modern OpenGL interface.
    • libpng: Portable Network Graphics library to load .png-files.
    • X11: Basic graphics interface for Linux to create a windows.
    #!/usr/bin/env bash
    LIBS="$(pkg-config --libs glew) $(pkg-config --libs libpng) $(pkg-config --libs x11) -lpthread"
    g++ -std=c++17 -o ./olcPGE $LIBS ./olcExampleProgram.cpp
    
  • Unable to compile

    Unable to compile

    Hello ! I am compiling with g++ 9.2.0 on windows 10, and I get an error when compiling the example project:

    <experimental\filesystem> no such file or directory at line 288

    I've lookod up online and it seems that it is not availlable on windows with GCC.

    Is there any quick fixes to that problem ?

  • ASIO tutorial, getting 68 errors

    ASIO tutorial, getting 68 errors

    I'm getting a lot of errors and I don't know why, switched my c++ version to 17 in build settings and included everything. Please help anyone. Windows SDK version is 10.0.19041.0, build tools visual studio 2019 (v142)

    3>C:\Users\me\source\repos\ASIO\NetCommon\net_tsqueue.h(105,4): error C2953: olc::net::tsqueue: шаблон класса уже определен
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_tsqueue.h(105,4): error C2953: olc::net::tsqueue: шаблон класса уже определен
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_tsqueue.h(10): message : см. объявление "olc::net::tsqueue"
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(17,4): error C2953: olc::net::message_header: шаблон класса уже определен
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(13): message : см. объявление "olc::net::message_header"
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_tsqueue.h(10): message : см. объявление "olc::net::tsqueue"
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(17,4): error C2953: olc::net::message_header: шаблон класса уже определен
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(13): message : см. объявление "olc::net::message_header"
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(93,4): error C2953: olc::net::message: шаблон класса уже определен
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(23): message : см. объявление "olc::net::message"
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(116,4): error C2953: olc::net::owned_message: шаблон класса уже определен
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(105): message : см. объявление "olc::net::owned_message"
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_client.h(102,4): error C2953: olc::net::client_interface: шаблон класса уже определен
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_client.h(9): message : см. объявление "olc::net::client_interface"
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_connection.h(295,4): error C2953: olc::net::connection: шаблон класса уже определен
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_connection.h(13): message : см. объявление "olc::net::connection"
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_server.h(240,4): error C2953: olc::net::server_interface: шаблон класса уже определен
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_server.h(13): message : см. объявление "olc::net::server_interface"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(16,1): error C2955: "olc::net::client_interface": для использования класс шаблон требуется список аргументов шаблон
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_client.h(9): message : см. объявление "olc::net::client_interface"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(20): error C2641: Не удается вывести аргументы шаблона для "olc::net::message".
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(20): error C2783: olc::net::message<T> olc::net::message(void): не удается составить аргумент шаблон для "T"
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(23): message : см. объявление "olc::net::message"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(20,1): error C2780: olc::net::message<T> olc::net::message(olc::net::message<T>): требует аргументов: 1, имеется: 0
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(23): message : см. объявление "olc::net::message"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(26,7): error C2676: бинарный "<<": "olc::net::message" не определяет этот оператор или преобразование к типу приемлемо к встроенному оператору
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(27,3): error C3861: Send: идентификатор не найден
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(32): error C2641: Не удается вывести аргументы шаблона для "olc::net::message".
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(32): error C2783: olc::net::message<T> olc::net::message(void): не удается составить аргумент шаблон для "T"
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(23): message : см. объявление "olc::net::message"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(32,1): error C2780: olc::net::message<T> olc::net::message(olc::net::message<T>): требует аргументов: 1, имеется: 0
    3>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(23): message : см. объявление "olc::net::message"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(34,3): error C3861: Send: идентификатор не найден
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(41,4): error C2039: "Connect": не является членом "CustomClient".
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(15): message : см. объявление "CustomClient"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(62,9): error C2039: "IsConnected": не является членом "CustomClient".
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(15): message : см. объявление "CustomClient"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(64,11): error C2039: "Incoming": не является членом "CustomClient".
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(15): message : см. объявление "CustomClient"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(68,18): error C2039: "Incoming": не является членом "CustomClient".
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(15): message : см. объявление "CustomClient"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(70,12): error C3536: msg: не может использоваться до инициализации
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(72,38): error C2440: приведение типов: невозможно преобразовать "CustomMsgTypes" в "int"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(72,26): message : Для этого преобразования требуется явное приведение (static_cast, приведение в стиле С или приведение в стиле функции)
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(72,5): error C2046: недопустимый вариант выбора
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(80,36): error C2440: приведение типов: невозможно преобразовать "CustomMsgTypes" в "int"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(80,26): message : Для этого преобразования требуется явное приведение (static_cast, приведение в стиле С или приведение в стиле функции)
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(80,5): error C2046: недопустимый вариант выбора
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(85,10): error C2677: бинарный ">>": не найден глобальный оператор, принимающий тип "std::chrono::system_clock::time_point" (или приемлемое преобразование отсутствует)
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(90,39): error C2440: приведение типов: невозможно преобразовать "CustomMsgTypes" в "int"
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(90,26): message : Для этого преобразования требуется явное приведение (static_cast, приведение в стиле С или приведение в стиле функции)
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(90,5): error C2046: недопустимый вариант выбора
    3>C:\Users\me\source\repos\ASIO\Client\Client.cpp(94,10): warning C4552: ">>": результат выражения не используется
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(93,4): error C2953: olc::net::message: шаблон класса уже определен
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(23): message : см. объявление "olc::net::message"
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(116,4): error C2953: olc::net::owned_message: шаблон класса уже определен
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(105): message : см. объявление "olc::net::owned_message"
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_client.h(102,4): error C2953: olc::net::client_interface: шаблон класса уже определен
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_client.h(9): message : см. объявление "olc::net::client_interface"
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_connection.h(295,4): error C2953: olc::net::connection: шаблон класса уже определен
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_connection.h(13): message : см. объявление "olc::net::connection"
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_server.h(240,4): error C2953: olc::net::server_interface: шаблон класса уже определен
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_server.h(13): message : см. объявление "olc::net::server_interface"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(16,1): error C2955: "olc::net::server_interface": для использования класс шаблон требуется список аргументов шаблон
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_server.h(13): message : см. объявление "olc::net::server_interface"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(24,57): error C3203: "connection": неспециализированный класс шаблон нельзя использовать в качестве аргумента шаблон для параметра шаблон "_Ty", требуется действительный тип
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(33,60): error C3203: "connection": неспециализированный класс шаблон нельзя использовать в качестве аргумента шаблон для параметра шаблон "_Ty", требуется действительный тип
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(39,51): error C3203: "connection": неспециализированный класс шаблон нельзя использовать в качестве аргумента шаблон для параметра шаблон "_Ty", требуется действительный тип
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(39,125): error C2955: "olc::net::message": для использования класс шаблон требуется список аргументов шаблон
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(23): message : см. объявление "olc::net::message"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(39,122): error C2955: "olc::net::message": для использования класс шаблон требуется список аргументов шаблон
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(23): message : см. объявление "olc::net::message"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(18,43): error C2614: CustomServer: недопустимая инициализация члена: "server_interface" не является базовым классом или членом
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(26): error C2641: Не удается вывести аргументы шаблона для "olc::net::message".
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(26): error C2783: olc::net::message<T> olc::net::message(void): не удается составить аргумент шаблон для "T"
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(23): message : см. объявление "olc::net::message"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(26,1): error C2780: olc::net::message<T> olc::net::message(olc::net::message<T>): требует аргументов: 1, имеется: 0
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(23): message : см. объявление "olc::net::message"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(28,3): error C2839: недопустимый возвращаемый тип "_Ty2 *" для перегруженного "operator ->"
    2>        with
    2>        [
    2>            _Ty2=int
    2>        ]
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(28,11): error C2039: "Send": не является членом "std::shared_ptr<int>".
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(24): message : см. объявление "std::shared_ptr<int>"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(35,39): error C2839: недопустимый возвращаемый тип "_Ty2 *" для перегруженного "operator ->"
    2>        with
    2>        [
    2>            _Ty2=int
    2>        ]
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(35,47): error C2039: "GetID": не является членом "std::shared_ptr<int>".
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(24): message : см. объявление "std::shared_ptr<int>"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(43,1): error C2440: приведение типов: невозможно преобразовать "CustomMsgTypes" в "int"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(43,24): message : Для этого преобразования требуется явное приведение (static_cast, приведение в стиле С или приведение в стиле функции)
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(43,3): error C2046: недопустимый вариант выбора
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(45,24): error C2839: недопустимый возвращаемый тип "_Ty2 *" для перегруженного "operator ->"
    2>        with
    2>        [
    2>            _Ty2=int
    2>        ]
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(45,32): error C2039: "GetID": не является членом "std::shared_ptr<int>".
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(24): message : см. объявление "std::shared_ptr<int>"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(48,4): error C2839: недопустимый возвращаемый тип "_Ty2 *" для перегруженного "operator ->"
    2>        with
    2>        [
    2>            _Ty2=int
    2>        ]
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(48,12): error C2039: "Send": не является членом "std::shared_ptr<int>".
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(24): message : см. объявление "std::shared_ptr<int>"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(52,1): error C2440: приведение типов: невозможно преобразовать "CustomMsgTypes" в "int"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(52,24): message : Для этого преобразования требуется явное приведение (static_cast, приведение в стиле С или приведение в стиле функции)
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(52,3): error C2046: недопустимый вариант выбора
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(54,24): error C2839: недопустимый возвращаемый тип "_Ty2 *" для перегруженного "operator ->"
    2>        with
    2>        [
    2>            _Ty2=int
    2>        ]
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(54,32): error C2039: "GetID": не является членом "std::shared_ptr<int>".
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(24): message : см. объявление "std::shared_ptr<int>"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(57): error C2641: Не удается вывести аргументы шаблона для "olc::net::message".
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(57): error C2783: olc::net::message<T> olc::net::message(void): не удается составить аргумент шаблон для "T"
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(23): message : см. объявление "olc::net::message"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(57,1): error C2780: olc::net::message<T> olc::net::message(olc::net::message<T>): требует аргументов: 1, имеется: 0
    2>C:\Users\me\source\repos\ASIO\NetCommon\net_message.h(23): message : см. объявление "olc::net::message"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(59,11): error C2839: недопустимый возвращаемый тип "_Ty2 *" для перегруженного "operator ->"
    2>        with
    2>        [
    2>            _Ty2=int
    2>        ]
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(59,19): error C2039: "GetID": не является членом "std::shared_ptr<int>".
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(24): message : см. объявление "std::shared_ptr<int>"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(60,4): error C3861: MessageAllClients: идентификатор не найден
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(71,9): error C2039: "Start": не является членом "CustomServer".
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(15): message : см. объявление "CustomServer"
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(75,10): error C2039: "Update": не является членом "CustomServer".
    2>C:\Users\me\source\repos\ASIO\Server\Server.cpp(15): message : см. объявление "CustomServer"
    
  • Segmentation Fault on Ubuntu 20.04

    Segmentation Fault on Ubuntu 20.04

    Hello, I am trying to compile the Hello World script using g++ -o play HelloWorld.cpp -lX11 -lGL -lpthread -lpng -lstdc++fs -std=c++17 of the pixel game engine on Ubuntu 20.04 and I am getting the following error when I try to run the executable using ./nameOfExecutable

    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    
    Program received signal SIGSEGV, Segmentation fault.
    0x0000555555569fe8 in olc::Platform_Linux::CreateWindowPane(olc::v2d_generic<int> const&, olc::v2d_generic<int>&, bool) ()
    

    Am I missing something? I would really appreciate some help.

  • In VSC '_gfs' has not been declared. #60 does not fix it for me.

    In VSC '_gfs' has not been declared. #60 does not fix it for me.

    ///////////////////////////////// tl;dr: Just use Visual Studio ////////////////////////////////

    I'm aware that this issue has supposedly been already resolved, nevertheless my compiler is still complaining.

    I am currently on a 64bit Windows machine, using the latest version of Visual Studio Code, using the latest GNU compiler. g++ version: 9.3.0 gcc version: 9.3.0 gdb version: 9.2 cpp version: 9.3.0

    After downloading the olcPixelGameEngine.h (version 2.15) and copying over the demo program provided in the header file I got the standard '<experimental/filesystem> no such file or directory'-error. I went ahead and commented that section out since it was enclosed by if clauses. After that, I went through an involuntary trip through beginner programmer hell. I began with the 'gfs has not been declared' -error. So I went on the internet to find a solution. The only source of suggestions was this very repository. I came across #60 where the issue has apparently been resolved. I checked my own version of the header file and it says: #if defined(__linux__) || defined(__MINGW32__) So, this could not have been the source of the problem. After some additional searching, I came across a different post that suggested to download a better and more up to date version of the mingw compiler via MSYS2. Here's the video for that. So I downloaded and installed IT and specified the new compiler location in the tasks.json file. The problem this time was that there was no debugger. So, I uninstalled MSYS2 and got myself a GNU compiler instead. After creating an environment path and specifying the new compiler/debugger location I got this working as well (I tested it on other, smaller programs I had created). Still, the 'gfs has not been declared'-error persisted. I reinstalled the compiler, I reinstalled VSCode, I restarted my computer, I tried the following compiler flags: -luser32 -lgdi32 -lopengl32 -lgdiplus -lShlwapi -ldwmapi -lstdc++fs -static -std=c++17, I removed the ''s around MINGW32, I added some more, I changed it to MINGW64, I removed the ''s from '_gfs' but so far nothing has worked. The '_gfs has not been declared'-error still plagues me.

  • olcExampleProgram draws white screen on Linux

    olcExampleProgram draws white screen on Linux

    I was just able to compile and run the example program.

    (My second program on Linux, right after Hello World of course.)

    The example program draws white pixels, instead of random colors, resulting in a white blank screen.

    When I debug with a breakpoint at the Draw command line (line 24 as of now) I see that the rand() returns random values, and rand() %255 returns meaningful (and seemingly random values, 110, 56, 156, etc.).

    Therefore I suppose either the olc:: pixel() function or the Draw function, or a library of my setup is to blame for the issue.

    Any help would be appreciated.

  • Compiling on OSX

    Compiling on OSX

    I did this to compile on OSX and it worked perfectly. OSX 10.14.6 (18G95)

    /usr/local/bin/g++-9 -o olcExample olcExampleProgram.cpp -L/opt/X11/lib -lX11 -lGL -lpthread -lpng -framework OpenGL -I/opt/X11/include

    g++ was installed through brew (clang fails)

    I didn't submit a pull on documentation, didn't want to assume how you wanted it.

  • olcPGEX_Sound doesn't work correctly

    olcPGEX_Sound doesn't work correctly

    I wanted to use a sound in my amazing pixel game, so I tried to use example to figure out how sound works in OLC, but I got this ERROR, another errors is refers to that one: namespace "olc" has no member "ResourceBuffer" olcPGEX_Sound.h 297. And this error is actually right, OLC doesn't have member ResourceBuffer. Fix it please. Best wishes.

  • Unable to build/run program

    Unable to build/run program

    I always encounter the following error message when trying to build a program (with the olcPixelGameEngine.h file) with the command g++ -o olcExampleProgram olcExampleProgram.cpp -lX11 -lGL -lpthread -lpng -lstdc++fs

    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lX11 C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lGL C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lpng collect2.exe: error: ld returned 1 exit status

    This is quite confusing to me, because I have used Ubuntu to install the libpng-dev, the libx11-dev and the libglu1-mesa-dev librarys, as well as the ubuntu build essentials. I currently don't have any idea what to do now.

    Building any other cpp file works just fine.

    Btw, when I try to build using the "Run Build Task" Option in the "Terminal" menu, I encounter the error log that I attached Error log VSCode.txt

  • Mouse Methods always return 0

    Mouse Methods always return 0

    PS - I will be linking full code later, I need to wait for confirmation from an artist on using their art

    Here is the snippet of code, it lives inside the OnUserUpdate() method

    const olc::vi2d vMousePos = GetMousePos();
    bool bRighMousePress = GetMouse(0).bHeld;
    std::cout << GetMousePos() << ", " << " | " << bRighMousePress << std::endl;
    

    However, the print method always shows me:

    (0,0),  | 0
    

    No matter where the mouse is, if it is being clicked or not.

  • Moving sprite *only* when mouse is clicking on it

    Moving sprite *only* when mouse is clicking on it

    Hello,

    I have a single sprite on screen and I am trying to make it so that when I press and hold on this particular sprite, I can move it with the mouse. I want this to happen only when I'm clicking on the sprite, not around it. The tutorial for "User Input" added functionality for controlling the ball with the mouse, although this piece of code only checks if the mouse is being held down, not whether you are actually pressing on the ball itself. The ball then simply teleports to where your mouse coords are. I am struggling to figure this out and would appreciate some help to point me in the right direction!

    Code example in question:

    // Cheat! Moving The Ball With Mouse
    
        if (GetMouse(0).bHeld)
        {
    	vBall = { float(GetMouseX()), float(GetMouseY()) };
        }
    
  • a logic bug in videos/Networking/Parts3&4/olcPGEX_Network.hpp: class connection

    a logic bug in videos/Networking/Parts3&4/olcPGEX_Network.hpp: class connection

    I was watching your videos on networking based on the asio lib. In Part3, function WriteValidation() and ReadValidation() were added to find out whether the client is a valid client that will send valid message so that our server won't get in trouble. But in Part2, you said that the OnClientConnect() function is used to give user a chance to deny the client, where user already has access to connection<T>::Send() function and calls WriteHeader() in its lambda callback function, which raise the calling chain and may get invalid data before validating the connection.

    And it's also not neat to do user-varies validation in a class, i.e. connection, that shouldn't be modified by users. Maybe implementing validation part in the server_interface class and making scramble() a virtual function is a better way, so that users can overload it and implement their own validation function in their own server class.

  • olcPGEX_network : Latency while using a very small network: two Computers and one Switch Fast Ethernet device

    olcPGEX_network : Latency while using a very small network: two Computers and one Switch Fast Ethernet device

    I have tested the basic server example with "olcPGEX_network.h" and the correspondent YouTube videos, in a local network. It is connected by a physical cable with two Windows OS computers (the 1st with Win11_x64 and the 2nd with Win7_x64) and one switch device.

    The issue is that I have measured around 200-300 ms while "pinging" the client and the server by pressing the number '1' on the keyboard. For comparison, I also measured the Windows ping command and obtain around 1 ms.

    Remark 1: This latency is also occurring for other messages than "ping". Remark 2: This latency is not occurring while using LocalHost (127.0.0.1) - In that case, I have measured less than 1 ms.

  • WSL2: X Error of failed request:  BadWindow (invalid Window parameter)

    WSL2: X Error of failed request: BadWindow (invalid Window parameter)

    The following error appears when using under WSL with a VcXsrv server.

    Starting program: /home/nitanmarcel/olc/appname
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    [New Thread 0x7ffff6fc3700 (LWP 129580)]
    X Error of failed request:  BadWindow (invalid Window parameter)
      Major opcode of failed request:  149 (GLX)
      Minor opcode of failed request:  0 ()
      Resource id in failed request:  0x200002
      Serial number of failed request:  32
      Current serial number in output stream:  32
    [Thread 0x7ffff6fc3700 (LWP 129580) exited]
    [Inferior 1 (process 129576) exited with code 01]
    

    Other apps that uses X11 for example glxgears work without any issues: image

  • Creating a window where the Y resolution exceeds the bounds of your monitor causes no rendering

    Creating a window where the Y resolution exceeds the bounds of your monitor causes no rendering

    My monitor size is 1920x1080. When I Construct() a window where the Y resolution exceeds the bounds of my monitor (even if it's less than 1080 but goes off the monitor due to the window not being maximized and slightly offset from the top left) I get an indefinite black screen.

    If I set the window to be full screen, this still happens only if the Y resolution exceeds your monitor resolution.

    image image

Simple Directmedia Layer, 1.2 branch ... ***DEPRECATED***, please use https://github.com/libsdl-org/SDL for new projects!

DEPRECATED The 1.2 branch of SDL is deprecated. While we occasionally collect fixes in revision control, there has not been a formal release since 201

Sep 19, 2022
Collections of AndLua modding related projects

AndLua Modding Projects Just my collections of AndLua modding related projects. Sorry, if I become file hoarder now, I collect everything but never us

Sep 24, 2022
SubLink is a C++ library used for constructing and analyzing merger trees in numerical simulations of galaxy formation

README SubLink is a C++ library used for constructing and analyzing merger trees in numerical simulations of galaxy formation. Brief description SubLi

Jan 20, 2022
Improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World.
Improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World.

OpenXRay OpenXRay is an improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World. S

Oct 2, 2022
A repo of game server configuration files used by LinuxGSM

Game Server Config Files Note: This repo is very new and currently missing most config files. More will be added over time. This is a repo of config f

Sep 26, 2022
Unreal Engine 4 plugin for Yodo1 MAS (Managed Ad Services) integration. Used for ad monetization of games.

Unofficial Yodo MAS SDK for Unreal Engine 4 Disclaimer: this plugin is in no way associated with Yodo1, this is just a wrapper on top of their officia

Apr 9, 2022
C++ game engine inspired by quake. Modern rendering and quake mapping tool integration.

Nuake Feel free to join the discord server for updates: What is it Nuake is a game engine written from scratch by myself. It is not meant to be a end-

Aug 16, 2022
YYToolkit is a tool for creating mods and altering GameMaker games.

YYToolkit is a tool for creating mods and altering GameMaker games.

Aug 10, 2022
Insomniac games cache simulation tool plugin for UE4
Insomniac games cache simulation tool plugin for UE4

Insomniac Games CacheSim plugin for UE4 This plugin for Unreal Engine 4 lets you use the Insomniac Games Cache Simulation tool to detect cache misses

Aug 27, 2022
A procedural sprite animation tool made with the nCine

SpookyGhost A procedural sprite animation tool made with the nCine. You can read the manual online or you can access it by pressing F1 in the program.

Oct 2, 2022
Game tool for Umamasume

UmaCruise-U Game tool for Umamasume A customized version of UmaUmaCruise Get more information about UmaCruise-U over here(Simplified Chinese) Relative

Sep 3, 2022
Mobile Studio tool integration with C# scripting for the Unity game engine.

Mobile Studio Package This project is a Unity package for integrating the Mobile Studio tool suite into game development workflows. This version of th

Sep 28, 2022
A small tool with Windows Minesweeper game

Donkey Minesweeper A small tool with Windows Minesweeper game Background As a high school student learning Olympics Informatic. Sometimes we have to u

Nov 13, 2021
A tool to render half life's collision hulls
A tool to render half life's collision hulls

Overview This is a tool that computes and renders the collision hulls of GoldSrc maps (BSP version 30), such as Half-Life 1 and Opposing Force maps. T

Mar 17, 2022
The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++

DirectX Tool Kit for DirectX 11 http://go.microsoft.com/fwlink/?LinkId=248929 Copyright (c) Microsoft Corporation. November 8, 2021 This package conta

Oct 1, 2022
A Binary Clock. Written 3 different ways. C and SDL, Python and PyGame, Python and PyGame Zero.

Super Clock A Binary Clock. Written 3 different ways. Python with PyGame Zero, Python with PyGame and C with SDL2. Time is displayed in 3 groups of 8

Dec 8, 2021
Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more
Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more

EnTT is a header-only, tiny and easy to use library for game programming and much more written in modern C++. Among others, it's used in Minecraft by

Oct 1, 2022
Powerful, mature open-source cross-platform game engine for Python and C++, developed by Disney and CMU
Powerful, mature open-source cross-platform game engine for Python and C++, developed by Disney and CMU

Panda3D Panda3D is a game engine, a framework for 3D rendering and game development for Python and C++ programs. Panda3D is open-source and free for a

Sep 27, 2022
OGRE is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce games and demos utilising 3D hardware.
OGRE  is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce games and demos utilising 3D hardware.

OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce games and demos utilising 3D hardware. The class library abstracts all the details of using the underlying system libraries like Direct3D and OpenGL and provides an interface based on world objects and other intuitive classes.

Sep 24, 2022