Welcome to DosPaint 2.0! 🎉 This project is a nostalgic recreation of a paint application, originally developed in C and BGI as my college final year project back in 1999. 🕰️ After losing the original floppy disk, I meticulously re-typed the entire source code from printouts, successfully bringing this classic application back to life. 🚀
My long-standing wish was to rebuild it using C++, and with the advent of Generative AI, I finally embarked on this journey. This project serves as an exciting experiment in leveraging AI to revive and modernize legacy software. ✨ But this project is not simply owed to Gemini 🤖; my blood and sweat went into it a lot 😓. It was a pain to get it done with Gen AI 😖. Sometimes I took control by coding myself 🧑💻.
- 🎨 DosPaint 2.0
- Drawing Tools: A variety of drawing tools, including freehand drawing, lines, circles, rectangles, and other shapes.
- Color Palette: A selectable color palette for choosing drawing colors.
- Toolbox: A toolbox for selecting different drawing tools and shapes.
- Attribute Selection: Options to change attributes like line style and fill patterns.
- Menu Bar (TODO): A menu bar with file and edit options.
- Status Bar: A status bar to display current tool information and coordinates.
- UI Components: A custom UI library with buttons, labels, and panels.
- Programming Language: C++
- Compiler: Turbo C++ 3.0
- Graphics Library: Borland Graphics Interface (BGI)
- Target Environment: DOS
- Windows 11
- A version of Turbo C++ 3.0 bundled with an emulator like DOSBox.
- Download Turbo C++ 3.0: Download a version of Turbo C++ that is packaged for modern Windows systems. These downloads typically include the original Turbo C++ files and a pre-configured DOSBox emulator.
- Extract and Install:
- If you have a previous version of Turbo C++ installed, uninstall it first.
- Extract the downloaded
.zipfile. - Run the
setup.exeorinstall.exefile and follow the on-screen instructions.
- Launch Turbo C++: A shortcut to Turbo C++ should be created on your desktop. Double-click it to launch the IDE.
- Open the Options Menu: In the Turbo C++ IDE, navigate to the Options menu.
- Set Directories:
- Go to Options > Linker > Libraries and set the Graphics Library to
On. - Go to Options > Directories and set the BGI path to
C:\Turboc3\BGI(or the equivalent path in your installation).
- Go to Options > Linker > Libraries and set the Graphics Library to
- Open the Project: In the Turbo C++ IDE, go to Project > Open Project... and select the project file for this application.
- Compile the Code: Go to Compile > Make to compile the project.
- Don't forget to create the output folder (say "BIN") and configure it in editor otherwise build will fail
- Run the Application: Go to File->DOS Shell type "BIN\DOSPAINT.EXE" to execute the compiled application.
The Borland Graphics Interface (BGI) is a simple graphics library for DOS. Here's a basic example of how to create a simple graphics application: (there is sample BGIDEMO.C included in BGI folder for reference)
#include <graphics.h>
#include <conio.h>
int main() {
// Initialize the graphics mode
int gd = DETECT, gm;
initgraph(&gd, &gm, "C:\\Turboc3\\BGI");
// Check for errors
if (graphresult() != grOk) {
return -1;
}
// Draw a circle
circle(320, 240, 100);
// Wait for a key press
getch();
// Close the graphics mode
closegraph();
return 0;
}initgraph(): Initializes the graphics system.closegraph(): Shuts down the graphics system.graphresult(): Returns an error code for the last graphics operation.- Drawing functions like
circle(),line(),rectangle(), etc.
This project was generated with the assistance of a large language model as an experiment in creating legacy software. The primary goal was to explore the capabilities of AI in understanding and generating code for older platforms and environments.
This project is licensed under the MIT License.
- 🧠 The memory management needs to be improved. There are smart pointers implemented that needs to be integrated.
- ✨ There some painting issues or flickering that needs to be fixed.
- 💾 The save and open features needs to be implemented. Save is partially done, just to see how to launch a dialog overlay.
- 🖱️ The text box click and edit is not working some times.
- 📜 Menu support needs to be added.

