Creating A Text-Based Graphics Engine in C++ from Scratch in ReactOS

Поділитися
Вставка
  • Опубліковано 13 тра 2024
  • Creating A Text-Based Graphics Engine in C++ from Scratch in ReactOS
    Installing a dark theme: bit.ly/2UeZWfP
    Line drawing algorithm: bit.ly/2XcOOSu
    Source code: bit.ly/2V0BpQb
  • Наука та технологія

КОМЕНТАРІ • 22

  • @sshado2
    @sshado2 5 років тому +8

    This is great and amazingly well captured and explained without using too many words. Nice job.

  • @TheKhakPakflyest
    @TheKhakPakflyest 4 роки тому +4

    Have you ever thought about doing that 3D Text-based game idea? Those are so dope. Great video though!

  • @MatheusAugustoGames
    @MatheusAugustoGames 3 роки тому +4

    Programmers have light mode since light attracts bugs.

    • @dropfish3109
      @dropfish3109 Рік тому

      And you’ll have less bugs if you’re in dark mode. They are actively trying to sabotage you.

  • @magmachicken4402
    @magmachicken4402 2 роки тому

    You inspired me, thank you

  • @dariusduesentrieb
    @dariusduesentrieb 5 років тому +15

    How stable was ReactOS during development? (How often did it crash/freeze)

    • @Mashpoe
      @Mashpoe  5 років тому +14

      It only froze once, and that was because I made a program that loops with no exit condition. It's certainly not stable enough to completely replace windows, but you can get most things to work with some effort!

    • @illen9942
      @illen9942 5 років тому

      @@ExceedingRectified Unfortunately ReactOS' resource management isn't quite good yet, it oftenly happens even with normal priority. Lowering the process priority to lowest setting possible is a workaround for that, and actually tends to improve the performance of the process and system itself.

    • @Mashpoe
      @Mashpoe  5 років тому +2

      @@ExceedingRectified It froze when I tried to close the program, not while the loop was actually running. My guess is that the OS froze because my program was making a large number of api calls while being closed. It didn't always happen, but when it did freeze I was rendering content very quickly in a while loop. Considering all the stuff I did, ReactOS was performing very well compared to earlier versions.

  • @Xonasa1
    @Xonasa1 5 років тому +2

    Did you try to set the compatibility layer to Vista for the Git Setup.exe?

  • @FrostGamingHype
    @FrostGamingHype 2 роки тому

    sir i did the same thing but when my texture touch each other they flicker very much does not effect fps but looks wired

  • @superarcherg5320
    @superarcherg5320 2 роки тому

    I'd love to see a follow up :/
    Great job though!

  • @TheCobaltKnight27
    @TheCobaltKnight27 2 роки тому

    You should do another video on reactos. They need the publicity.

  • @FrostGamingHype
    @FrostGamingHype 2 роки тому

    i want to know how to add trancepry effect because i loded text files as my textures please /_\ help me out

    • @Mashpoe
      @Mashpoe  2 роки тому +1

      If you're doing this with the code I wrote, just create a texture object, load from a file, and set transparency to Game::TRANSPARENT_BG like so:
      Game::Texture tex;
      tex.load("example.txt");
      tex.setTransparency(Game::TRANSPARENT_BG);
      You can also change the color of the foreground:
      tex.setColor(Game::FG_LIGHT_YELLOW);
      If you want more example code, check out the demo I made at github.com/Mashpoe/ReactOS-Game/. There are some good code examples in GameState.cpp.
      The default background character is space, so it will treat spaces as transparent pixels. You can change which character is ignored with the setBackground() method:
      // now the character 'A' will be ignored and treated as a transparent background
      tex.setBackground('A');

    • @FrostGamingHype
      @FrostGamingHype 2 роки тому

      @@Mashpoe sir thats not what i meant making it from scrath in c++ please help me out i know you got the sol the thing is i made an whole cool graphics engine like yours has everything in ascii but i messed up and want to create transparent effect like and im not using any engine and i also want to know that how can i want to load tile set method for my textures for my game engine it will help me a lot or you can try to share your transparent code and the load tile set code it will not only help me but others too here an like and subcribe

    • @Mashpoe
      @Mashpoe  2 роки тому +1

      @@FrostGamingHype This file in my GitHub project shows how I use the tileset functionality and the transparency effect: github.com/Mashpoe/Windows-Console-Game-Library/blob/master/Texture.cpp.
      The functionality for both of these features is implemented in the function Texture::render().
      The tileset clipping uses a Rect struct to determine the clipping boundary. Here is the code for the Rect struct: github.com/Mashpoe/Windows-Console-Game-Library/blob/master/Rect.hpp.
      Rect objects store x, y, w, and h values to define a rectangle at the position (x, y) with the width (w) and the height (h). The Rect parameter for the function Texture::render() determines which characters from the tileset to render. Any characters that are within the bounds of the Rect are drawn (except for the transparent ones). You have to make sure the Rect fits within the bounds of the tileset Texture though. My program automatically clips the Rect to make sure it fits within the tileset Texture's boundary.
      All you have to do for transparency is pick a character to ignore (e.g. space) and just write code that skips that character when rendering a texture. In order for the transparency effect to work, you have to render the object with the transparent background after you render whatever you want behind it.
      All of the code for my graphics library can be viewed from the GitHub repo: github.com/Mashpoe/Windows-Console-Game-Library.

    • @FrostGamingHype
      @FrostGamingHype 2 роки тому

      ​@@Mashpoe thanks sir sorry for commenting but i done want your whole code because if i copy 1 thing so i will have to copy the whole code which i dont want to do since its just copying an game engine so i rather how to make it i just wanted 1 function can you comment me your texture load function by copying it because its your code not mine i dont know what your doing with functions so can you paste the tile set texture code right here i may have builded 2 game engine in 1 year but your game engine is good thats why i was building an 3rd one also because my game engine is pretty done so please if you want to write the sol please do and if not soo its your will so all i wanted to say that can you tell by writting the code

    • @Mashpoe
      @Mashpoe  2 роки тому +1

      You don't have to copy my code, but you can read it and try to understand it so you can add the same features to your own code.
      Being able to read and understand other people's code is a very important skill to learn, and my console library is relatively simple and there are some useful comments in the code that are there to help you understand how it all works.
      I think most of the code you need is in the files Texture.hpp and Texture.cpp.
      The code for loading the textures is in the function Texture::load() and the code for drawing textures with transparency and tileset clips in the function Texture::render().
      I'm not telling you to copy my code, but instead to try and understand how it works by reading it.
      My previous comment explains a little bit about how the render function works, but I can't explain every line of code to you or write your program for you.
      The simplest way to understand the code is to read it. Try looking through the files and through the different functions to see what's going on.
      I hope this helps. That's about all I can do for you. Good luck on your game engine!

  • @d4ny3l23
    @d4ny3l23 4 роки тому +1

    tutorial!!!