+
Skip to content

Wiladams/ndt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ndt

Newgrammer Development Tools

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.

Examples

analogclock

analogclock

  • Project: analogclock
  • Notes: animation, transparency, rotation

angler

angler

  • Project: angler
  • Notes: compound animation, rotation, timing

bannersketch

bannersketch

  • Project: bannersketch
  • Notes: semi-transparent, full screen overlay

calendar

calendar

  • Project: calendar
  • Notes: Text of different sizes, calendar object

calib

calib

  • Project: calib
  • Notes: using display dpi, user specified units per inch

cards

cards

  • Project: cards
  • Notes: card deck, sprite sheet, shuffle operation

colorama

colorama

  • Project: colorama
  • Notes: rgb color from frequency, gamma adjust

compkeyboard

compkeyboard

  • Project: compkeyboard
  • Notes: transparent window, raw global keyboard input, data structures

desktoplife

desktoplife

  • Project: desktoplife
  • Notes: desktop, automata, rectangle drawing

displays

displays

  • Project: displays
  • Notes:per monitor snapshot, display mini-screen

finalysis

finalysis

  • Project: finalysis
  • Notes: windows, file drop, file stream

fontsum

fontsum

  • Project: fontsum
  • Notes: font, text size

fontview

fontview

  • Project: fontview
  • Notes: font, design metrics, contour details

gauges

gauges

  • Project: gauges
  • Notes:thick lines, arc segments, linear interpolation

glyphbook

glyphbook

  • Project: glyphbook
  • Notes:directory iteration, font render, font sizing

graph2d

graph2d

  • Project: graph2d
  • Notes: mouse tracking, direct pixel setting, apphost

infinical

infinical

  • Project: infinical
  • Notes: gesture, calendar, panning

lerpcolor

lerpcolor

  • Project: lerpcolor
  • Notes: Linear interpolation of color, fast polygon fill

lsystem

lsystem

  • Project: lsystem
  • Notes: lindemeyer system, whole desktop transparency

monitorview

monitorview

  • Project: monitorview
  • Notes: display monitor capture, bitmap scaling

multiwall

multiwall

  • Project: multiwall
  • Notes: desktop capture, high volume bitmap display, bitmap scaling

parimage

parimage

  • Project: parimage
  • Notes: pixel effects (masking, tinting)

portablegl

portablegl

  • Project: portablegl
  • Notes: portable GL, OpenGL 3.0 software renderer, framebuffer

pubit

pubit

  • Project: pubit
  • Notes: pubsub, event topics, joystick, mouse, keyboard

rain

rain

  • Project: rain
  • Notes: fullscreen, particles, desktop interaction

rainbow

rainbow

  • Project: rainbow
  • Notes: color blending, fullscreen, transparency

ratiow

ratiow

  • Project: ratiow
  • Notes: ray tracer, buttons

remoter

remoter

  • Project: remoter
  • Notes: encode, decode graphics commands

screenplanes

screenplanes

  • Project: screenplanes
  • Notes: pixel operations to separate color planes, screen capture

shapes

shapes

  • Project: shapes
  • Notes: drawing path based shapes

simchain

simchain

  • Project: simchain
  • Notes: simulated springs, full screen, semi-transparent

sinwave

sinewave

  • Project: sinwave
  • Notes: display sin and cosine functions

sketchy

sketchy

  • Project: sketchy
  • Notes: drawing program, mouse, path, pen

snapview

snapview

  • Project: snapview
  • Notes: screen snapshot, mipmap

spirograph

spirograph

squardle

squardle

  • Project: squardle
  • Notes: drop shadows, painter's algorithm drawing

starfield

starfield

  • Project: starfield
  • Notes: animation, full screen

svgcolors

svgcolor

  • Project: svgcolors
  • Notes: Display colors from SVG palette, scroll with mouse wheel

svgbrowser

svgbrowser

  • Project: svgbrowser
  • Notes: Drag-drop svg images, icon view, maleable detail view

targaviewer

targaviewer

  • Project: tgaviewer
  • Notes: Display bitmap from .tga file

tinygl

tinygl

  • Project: tinygl
  • Notes: software only OpenGL implementation

tinyvgviewer

tinyvgviewer

  • Project: tinyvgviewer
  • Notes: parsing and displaying tinyvg graphic files

tinyrenderer

tinyrenderer

  • Project: tinyrenderer
  • Notes: software 3D renderer, OBJ model viewing

touchy

touchy

  • Project: touchy
  • Notes: demonstrate using multi-point touch interface

usmap

usmap

  • Project: usmap
  • Notes: SVG path, interactive graphics, hovering

WaltzOfTheCircles

WaltzOfTheCircles

wavemaker

wavemaker

  • Project: wavemaker
  • Notes: follow the mouse, using trig functions

Compiling

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

Some Details

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);
}

Creating a new project

  • 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

Bits And Bobs

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.

Random References

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

Things to try

Processing and P5 worlds are full of great things to play with.

About

Newgrammer Development Tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载