Max OS 0.3
Loading...
Searching...
No Matches
textmode.h
Go to the documentation of this file.
1
9#ifndef MAXOS_CONSOLE_TEXTMODECONSOLE_H
10#define MAXOS_CONSOLE_TEXTMODECONSOLE_H
11
12#include <cstdint>
13#include <console/console.h>
14
15
16namespace MaxOS::console {
17
22 class TextModeConsole : public Console {
23 private:
24 uint16_t* m_video_memory { (uint16_t*) 0xB8000 };
25
26 public:
29
30 uint16_t width() final;
31 uint16_t height() final;
32
33 void put_character(uint16_t x, uint16_t y, char c) final;
34 void set_foreground_color(uint16_t x, uint16_t y, common::ConsoleColour) final;
35 void set_background_color(uint16_t x, uint16_t y, common::ConsoleColour) final;
36
37 char get_character(uint16_t x, uint16_t y) final;
38 common::ConsoleColour get_foreground_color(uint16_t x, uint16_t y) final;
39 common::ConsoleColour get_background_color(uint16_t x, uint16_t y) final;
40 };
41
42}
43
44
45#endif //MAXOS_CONSOLE_TEXTMODECONSOLE_H
Abstract class for a console, allows for the printing of characters and strings with colours.
Definition console.h:25
Driver for the text mode console, handles the printing of characters and strings to the screen using ...
Definition textmode.h:22
void put_character(uint16_t x, uint16_t y, char c) final
Places a character at the specified location if it is in bounds.
Definition textmode.cpp:44
common::ConsoleColour get_background_color(uint16_t x, uint16_t y) final
Gets the background color at the specified location.
Definition textmode.cpp:144
void set_background_color(uint16_t x, uint16_t y, common::ConsoleColour) final
Sets the background color at the specified location.
Definition textmode.cpp:84
common::ConsoleColour get_foreground_color(uint16_t x, uint16_t y) final
Gets the foreground color at the specified location.
Definition textmode.cpp:124
uint16_t width() final
Gets the width of the console.
Definition textmode.cpp:24
uint16_t height() final
Gets the height of the console.
Definition textmode.cpp:33
void set_foreground_color(uint16_t x, uint16_t y, common::ConsoleColour) final
Sets the foreground color at the specified location.
Definition textmode.cpp:64
char get_character(uint16_t x, uint16_t y) final
Gets the character at the specified location.
Definition textmode.cpp:104
Defines a Console class for handling text-based console output with colour support.