Skip to content

Commit 4789794

Browse files
committed
big update: remove DOS_Text
1 parent 0141e40 commit 4789794

File tree

6 files changed

+194
-620
lines changed

6 files changed

+194
-620
lines changed

README.md

+7-35
Original file line numberDiff line numberDiff line change
@@ -79,34 +79,6 @@ SDL_RenderPresent(renderer);
7979
8080
8181
82-
## Character Sprite Sheet
83-
84-
If you're doing a lot of rendering of text, or have a custom color palette, `DOS_Text` might provide better performance. Creating a `DOS_Text` generates a sprite sheet of CP437 characters.
85-
86-
```c
87-
#include <textmode.h>
88-
...
89-
SDL_Color my_palette[3] = {
90-
{ 255, 0, 0, 255 },
91-
{ 0, 255, 0, 255 },
92-
{ 0, 0, 255, 255 }
93-
};
94-
SDL_Renderer * renderer;
95-
...
96-
DOS_Text * text = DOS_CreateText(renderer, DOS_MODE40, my_palette, 3);
97-
DOS_CharInfo attr = DOS_DefaultAttributes(); // white text on black background
98-
DOS_TRenderString(text, 0, 0, &attr, "Hello, galaxy");
99-
...
100-
DOS_DestroyText(text);
101-
```
102-
103-
To create text with the default CGA palette, use the global variable `dos_palette`, which has 16 colors (`DOS_NUMCOLORS`).
104-
105-
```c
106-
DOS_Text * text = DOS_CreateText(renderer, DOS_MODE80, dos_palette, DOS_NUMCOLORS);
107-
```
108-
109-
11082
11183
## Console
11284
@@ -117,13 +89,13 @@ SDL_Renderer * renderer;
11789
...
11890
#define ROWS 10
11991
#define COLS 15
120-
DOS_Console * console = DOS_CreateConsole(renderer, COLS, ROWS, DOS_MODE80);
121-
DOS_CSetCursorType(console, DOS_CURSOR_FULL);
92+
DOS_Console * console = DOS_CreateConsole(COLS, ROWS, DOS_MODE80);
93+
DOS_SetCursorType(DOS_CURSOR_FULL);
12294
...
123-
DOS_ClearConsole(console); // clear to default attributes, cursor at 0, 0
124-
DOS_CGotoXY(console, 2, 2);
125-
DOS_CSetForeground(DOS_CYAN);
126-
DOS_CPrintString(console, "console size: %d x %d", COLS, ROWS);
95+
DOS_ClearScreen(); // clear to default attributes, cursor at 0, 0
96+
DOS_GotoXY(2, 2);
97+
DOS_SetForeground(DOS_CYAN);
98+
DOS_PrintString("console size: %d x %d", COLS, ROWS);
12799
...
128100
DOS_RenderConsole(console, 0, 0);
129101
SDL_RenderPresent(renderer);
@@ -135,7 +107,7 @@ DOS_DestroyConsole(console);
135107

136108
## Screen
137109

138-
Finally, if you need a full MS-DOS-like text mode program with a multiple page console and colored border, use a `DOS_Screen`. This use case is the least flexible, but provides the simplest interface for writing a text mode program.
110+
If you need a full MS-DOS-like text mode program with a multiple page console and colored border, use a `DOS_InitScreen()`.
139111

140112
```c
141113
#include <textmode.h>

0 commit comments

Comments
 (0)