RetroSharp or Retro# is a C# library that makes learning to develop fun and easy by creating a development environment mimicking early development environments (retro), while maintaining the benefits of a modern language like C#.
RetroSharp relies on OpenTK for OpenGL rendering. You don't need to download this library separately, as a binary file (release from 2014-07-23) is also available in Binaries folder in this project. If you want to get access to the source code for the OpenTK library, you can download it directly from their site.
If OpenGL is not available by default in your operating system, you might need to install it manually. The simplest way to do this, is to download new drivers for your graphics card.
RetroSharp also relies on OpenAL for audio-output. An installation file for OpenAL for Windows can also be found in the Binaries folder. You might need to install OpenAL on your machine, if it has not been installed previously.
To create a retro-application using RetroSharp, you only need to reference the RetroSharp library project and derive your application from the RetroApplication class. This class manages the retro environment, including execution, character sets, sprites, rendering, console input/output, keyboard & mouse input, events, resources, audio, hit-tests, drawing, file handling, etc., and it also manages the OpenTK, OpenGL and OpenAL libraries. Your application does not need to link to these libraries. The point of RetroSharp is to remove as much complexity of underlying libraries as possible, to make development quick, fun and easy and suitable for use for a first-time learner of programming.
To make it easier to create a new project, there are two template projects available for you from the start:
| Template | Description |
|---|---|
| Character Template | The character template project sets up a retro console application for you. It's suitable for text-type applications. |
| Raster Graphics Template | The raster graphics template project sets up a retro raster graphics application for you. It's suitable for applications where you need to need to draw on the screen. In raster graphics mode, you can still use console input/output if you choose to. |
To be able to use these templates from Visual Studio, you might have to export them first, once the solution has loaded. Just select the template project in the solution explorer and select Export Template... from the File menu to export a project as a project template. Once it has been exported as a project template it will be available as soon as you want to create a new project, in the list of available templates.
The solution includes a series of examples demonstrating how RetroSharp can be used. These examples are simple and aim to present a topic in a short and simple manner that is easy to read, understand, and reutilize. The examples are sorted into various categories, from very simple to more advanced.
For each project a small screen shot is presented, with a link to a full screen shot in the description. An executable file in a zip folder is also available if you want to try the program without compiling it. If you follow the Full Screen Shot and Executable links, make sure to click the Raw button on the page to view or download the entire file.
The examples sorted into the [Text and Strings](Examples/Text and Strings) category show how to input, process and output text in simple console applications.
| Screen Shot | Project description |
|---|---|
![]() |
The [Hello World](Examples/Text and Strings/HelloWorld) project is probably the first project for many. It displays a "Hello World" message in a console application, just to show basic console output. Full Screen Shot. Executable. |
![]() |
The [Guess a number](Examples/Text and Strings/GuessANumber) project lets the user guess a random number between 1 and 100. The application terminates when the user guesses the number correctly. Full Screen Shot. Executable. |
The examples available in the Arithmetics category show how to perform simple numerical calculations.
| Screen Shot | Project description |
|---|---|
![]() |
The Koch project displays the famous Koch snowflake. This project also illustrates the power of recursive computation. Full Screen Shot. Executable. |
![]() |
The Mandelbrot project is a homage to Mandelbrot and Julia, and the fractals that bear their names. This project also illustrates the power of iterative processes. You can navigate the fractals and smooth them out to create beautiful images. Full Screen Shot. Executable. |
![]() |
The Simple Arithmetics project shows how to perform simple computations with some basic console input/output. Full Screen Shot. Executable. |
![]() |
The Sinus1 project outputs a simple sinus graf in console mode. Full Screen Shot. Executable. |
![]() |
The Sinus2 project outputs a simple sinus graf in raster graphics mode. Full Screen Shot. Executable. |
The [Text Screen Manipulation](Examples/Text Screen Manipulation) category contains a list of projects showing how you can manipulate the text screen directly and modify character sets to create interesting applications.
| Screen Shot | Project description |
|---|---|
![]() |
The [Bouncing Character 1](Examples/Text Screen Manipulation/BouncingCharacter1) project shows how you can use direct screen manipulation to make a character bounce around the screen. Full Screen Shot. Executable. |
![]() |
The [Bouncing Character 2](Examples/Text Screen Manipulation/BouncingCharacter2) project adds objects on the screen to the [Bouncing Character 1](Examples/Text Screen Manipulation/BouncingCharacter1) project with which the character can interact by bouncing against them. Full Screen Shot. Executable. |
![]() |
The [Bouncing Character 3](Examples/Text Screen Manipulation/BouncingCharacter3) project adds simple user interaction though the keyboard to the [Bouncing Character 2](Examples/Text Screen Manipulation/BouncingCharacter2) project. Full Screen Shot. Executable. |
![]() |
The [Bouncing Character 4](Examples/Text Screen Manipulation/BouncingCharacter4) project customizes the characters in [Bouncing Character 3](Examples/Text Screen Manipulation/BouncingCharacter3) project and shows how this technique can be used to create more interesting character-based user interfaces. Full Screen Shot. Executable. |
![]() |
The [Bouncing Character 5](Examples/Text Screen Manipulation/BouncingCharacter5) project adds sound to the [Bouncing Character 4](Examples/Text Screen Manipulation/BouncingCharacter4) project, and plays a sound effect when the character bounces. Full Screen Shot. Executable. |
![]() |
The [Create Labyrinth](Examples/Text Screen Manipulation/CreateLabyrinth) project creates a random labyrinth on the screen and lets a small entity randomly walk around in the labyrinth. Full Screen Shot. Executable. |
Applications introducing raster graphics are available in the [Raster Graphics](Examples/Raster Graphics) category. The applications show how to perform different simple graphics operations.
| Screen Shot | Project description |
|---|---|
![]() |
The [Clip Lines](Examples/Raster Graphics/ClipLines) project modifies the [Moiré Lines](Examples/Raster Graphics/MoireLines) project, experimenting with line clipping to draw inside subsections of the screen. Full Screen Shot. Executable. |
![]() |
The [Gradients](Examples/Raster Graphics/Gradients) project shows how different procedural fill methods can be used. Full Screen Shot. Executable. |
![]() |
The [Moiré Lines](Examples/Raster Graphics/MoireLines) project shows an interesting visual effect when drawing lines on a raster display with limited resolution. Full Screen Shot. Executable. |
![]() |
The [Random Boxes](Examples/Raster Graphics/RandomBoxes) project randomly draws boxes on the raster display as quickly as possible. Full Screen Shot. Executable. |
![]() |
The [Random Ellipses](Examples/Raster Graphics/RandomEllipses) project randomly draws ellipses on the raster display as quickly as possible. Full Screen Shot. Executable. |
![]() |
The [Random FilledEllipses](Examples/Raster Graphics/RandomFilledEllipses) project randomly draws filled ellipses on the raster display as quickly as possible. Full Screen Shot. Executable. |
![]() |
The [Random Filled Polygons](Examples/Raster Graphics/RandomFilledPolygons) project randomly draws filled polygons on the raster display as quickly as possible. Full Screen Shot. Executable. |
![]() |
The [Random Lines](Examples/Raster Graphics/RandomLines) project randomly draws lines on the raster display as quickly as possible. Full Screen Shot. Executable. |
![]() |
The [Random Plots](Examples/Raster Graphics/RandomPlots) project randomly draws pixels on the raster display as quickly as possible. Full Screen Shot. Executable. |
![]() |
The [Random Polygons](Examples/Raster Graphics/RandomPolygons) project randomly draws polygons on the raster display as quickly as possible. Full Screen Shot. Executable. |
![]() |
The [Random Rectangles](Examples/Raster Graphics/RandomRectangles) project randomly draws rectangles on the raster display as quickly as possible. Full Screen Shot. Executable. |
![]() |
The [Random Rounded Boxes](Examples/Raster Graphics/RandomRoundedBoxes) project randomly draws rounded boxes on the raster display as quickly as possible. Full Screen Shot. Executable. |
![]() |
The [Random Rounded Rectangles](Examples/Raster Graphics/RandomRoundedRectangles) project randomly draws rectangles on the raster display as quickly as possible. Full Screen Shot. Executable. |
![]() |
The [Stars](Examples/Raster Graphics/Stars) project animates points on the screen, making it look like flying through space. Full Screen Shot. Executable. |
![]() |
The [Venn Diagram](Examples/Raster Graphics/VennDiagram) project draws a simple Venn Diagram illustrating the difference between flood the fill command and procedural fill. Full Screen Shot. Executable. |
Sprites are available in all screen modes, and provide a mechanism to display movable objects, possibly animated, on top of the screen. The projects in the Sprites category display different uses for sprites.
| Screen Shot | Project description |
|---|---|
![]() |
The Bouncing Balls project animates a set of bouncing balls over a console screen, with some sound effects. Full Screen Shot. Executable. |
![]() |
The Mouse Pointer allows the user to interact with the application using the mouse and draw on the raster screen. The project also shows how sprites can be rotated. Full Screen Shot. Executable. |
Networking makes it possible to create multi-user experiences over the local area network or the Internet. The projects in the Networking category show how network technologies can be used in retro applications.
| Screen Shot | Project description |
|---|---|
![]() |
The Latency project performs a test on an MQTT server and reports the time it takes to propagate a message across the network using different Quality of Service levels. Full Screen Shot. Executable. |
![]() |
The Multi Player Setup project shows how to create a multi-player environment. This multi-player environment first negotiates players (which is implicitly done using MQTT), and then establish peer-to-peer connections to all players in the environment. The application proceeds by providing a simple multi-user chat between connected peers. Negotiation is done using MQTT and the public MQTT server iot.eclipse.org. For peer-to-peer applications to work, UPnP must be enabled in the Internet Gateway. Full Screen Shot. Executable. |
![]() |
The Multi User Chat project creates a multi-user chat room and allows people running the same application to chat with each other. Communication is done using MQTT and the public MQTT server iot.eclipse.org. Full Screen Shot. Executable. |
![]() |
The Multi User Draw project creates a multi-user draw room and allows people running the same application to draw on the same screen together. Communication is done using MQTT and the public MQTT server iot.eclipse.org. Full Screen Shot. Executable. |
![]() |
The Peer to Peer project shows how to allow peers to connect to your application by registering the application in the internet gateway which will allow peers to traverse NAT-enabled firewalls to connect to your application. For peer-to-peer applications to work, UPnP must be enabled in the Internet Gateway. Full Screen Shot. Executable. |
Finally, the Games category contain more complete applications using the retro-environment to create a retro-game.
| Screen Shot | Project description |
|---|---|
![]() |
The Asteroids project implements a version of the classic Asteroids game. Full Screen Shot. Executable. |
![]() |
The Mask project implements a version of the classic Worms or Tron game (Mask is Swedish for Worms), with some extras. The game uses peer-to-peer communication to allow two players to play against each other over the Internet. The project illustrates peer-to-peer communication and the difference between UDP and TCP in gaming. Full Screen Shot. Executable. |
![]() |
The Mines project implements a version of the classic Mines game. Full Screen Shot. Executable. |
![]() |
The Text Adventure project implements the skeleton of a simple text adventure game. Full Screen Shot. Executable. |
![]() |
The Text Adventure 2 project generlizes the Text Adventure project by creating a text adventure engine that reads an XML file containing the information required to setup the game. Full Screen Shot. Executable. |







































