A repository of simple demo applications that show new programmers how to write code in C++.
The various concepts exhibited include data structures, algorithms, threading, memory management, graphics, event handling, and the like.
This code only runs on the Windows platform, but all the platform specific parts of creating a window, handling mouse, keyboard, joystick and the like are conveniently wrapped up in one place, and the programmer doesn't really deal with it.
- Project: analogclock
- Notes: animation, transparency, rotation
- Project: angler
- Notes: compound animation, rotation, timing
- Project: bannersketch
- Notes: semi-transparent, full screen overlay
- Project: calendar
- Notes: Text of different sizes, calendar object
- Project: calib
- Notes: using display dpi, user specified units per inch
- Project: cards
- Notes: card deck, sprite sheet, shuffle operation
- Project: colorama
- Notes: rgb color from frequency, gamma adjust
- Project: compkeyboard
- Notes: transparent window, raw global keyboard input, data structures
- Project: desktoplife
- Notes: desktop, automata, rectangle drawing
- Project: displays
- Notes:per monitor snapshot, display mini-screen
- Project: finalysis
- Notes: windows, file drop, file stream
- Project: fontsum
- Notes: font, text size
- Project: fontview
- Notes: font, design metrics, contour details
- Project: gauges
- Notes:thick lines, arc segments, linear interpolation
- Project: glyphbook
- Notes:directory iteration, font render, font sizing
- Project: graph2d
- Notes: mouse tracking, direct pixel setting, apphost
- Project: infinical
- Notes: gesture, calendar, panning
- Project: lerpcolor
- Notes: Linear interpolation of color, fast polygon fill
- Project: lsystem
- Notes: lindemeyer system, whole desktop transparency
- Project: monitorview
- Notes: display monitor capture, bitmap scaling
- Project: multiwall
- Notes: desktop capture, high volume bitmap display, bitmap scaling
- Project: parimage
- Notes: pixel effects (masking, tinting)
- Project: portablegl
- Notes: portable GL, OpenGL 3.0 software renderer, framebuffer
- Project: pubit
- Notes: pubsub, event topics, joystick, mouse, keyboard
- Project: rain
- Notes: fullscreen, particles, desktop interaction
- Project: rainbow
- Notes: color blending, fullscreen, transparency
- Project: ratiow
- Notes: ray tracer, buttons
- Project: remoter
- Notes: encode, decode graphics commands
- Project: screenplanes
- Notes: pixel operations to separate color planes, screen capture
- Project: shapes
- Notes: drawing path based shapes
- Project: simchain
- Notes: simulated springs, full screen, semi-transparent
- Project: sinwave
- Notes: display sin and cosine functions
- Project: sketchy
- Notes: drawing program, mouse, path, pen
- Project: snapview
- Notes: screen snapshot, mipmap
- Project: spirograph
- Notes: algorithmic drawing
- Project: squardle
- Notes: drop shadows, painter's algorithm drawing
- Project: starfield
- Notes: animation, full screen
- Project: svgcolors
- Notes: Display colors from SVG palette, scroll with mouse wheel
- Project: svgbrowser
- Notes: Drag-drop svg images, icon view, maleable detail view
- Project: tgaviewer
- Notes: Display bitmap from .tga file
- Project: tinygl
- Notes: software only OpenGL implementation
- Project: tinyvgviewer
- Notes: parsing and displaying tinyvg graphic files
- Project: tinyrenderer
- Notes: software 3D renderer, OBJ model viewing
- Project: touchy
- Notes: demonstrate using multi-point touch interface
- Project: usmap
- Notes: SVG path, interactive graphics, hovering
- Project: WaltzOfTheCircles
- Notes: mouse tracking, reactive geometry
- Project: wavemaker
- Notes: follow the mouse, using trig functions
The projects directory contains a Visual Studio solutions file which gives you ready access to all the coded up examples.
Install a relatively recent version of the Visual Studio environment, to get a Visual C++ compiler installed. Currently using Visual Studio 2019
Open up the projects.sln file in the \projects\projects.sln Make sure you're in Release mode Build the entire solution, play with examples
Graphics are supported by the blend2d library. Other than that, there are no other external dependencies.
In the directory structure, the '\primary' directory contains a bunch of very useful stuff that makes the programming super easy to play with. The most direct and easy way to get started is to use the p5 combination of files. These files give you a programming environment which is very familiar to what you would have in p5.js, but using C++ instead of javascript.
* apphost.h
* appmain.cpp
* p5.hpp
* p5.cpp
With these files included in your project, you have an environment where you only need to implement a couple of functions to put something on the screen.
void setup()
{
createCanvas(640,480);
}
void draw()
{
// draw a rectangle
rect(10,10,100,100);
}
-
Add libraries: blend2d.lib, ws2_32.lib
-
Set Additional Lib Directories to ....\lib\Release
-
Set C/C++ Additional Include Directories - ....\primary
-
Set C++ runtime to /Mt
Most functions in ndt are in classes that are in header files. That means ndt does not have a 'library' that programs link against. Each program is individual, and compiles down to a fairly small size.
C++ compiler intrinsics https://docs.microsoft.com/en-us/cpp/intrinsics/compiler-intrinsics?view=vs-2019
VS Code c++ task configuration https://code.visualstudio.com/docs/cpp/config-msvc
Processing and P5 worlds are full of great things to play with.