Skip to content

Exercises

bjornstahl edited this page Oct 14, 2021 · 5 revisions

Welcome to the Arcan Developer Exercises!

These are a series of exercises that intend to help you get perspective as to what Arcan can be used for and how to interpret documentation and debugging tools, how visualization problems can be broken down and approached, and as a means of incrementally get an idea of how the engine works internally.

The exercises have been grouped into three categories, based on their perceived difficulty (i.e. beginner, intermediate, advanced), with an additional 'low level' category for those that already are proficient but want to build more advanced systems or interoperate with the engine on lower levels.

Most exercises can be approached from two perspectives:

  • 'Curious', developer that has a graphical application in mind.

  • 'Engine Internals', developer that is interested in how the engine works.

For the curious developer, all you need is a working Arcan installation and a text-editor. For engine internals, being comfortable with C and associated developer tools is necessary. It might also be useful to have access to a minimalistic tracer, e.g. APITrace.

For the engine internals angle, the added dimensions is to breakpoint and trace through from the corresponding entry-points in the engine source - see which subsystems they map to and so on.

Note that the exercises marked Low Level only target those interested in engine internals and lower system level work (e.g. how to interact with the engine by writing custom sources and sinks etc). It will require access to a deeper programming environment outside of Arcan itself.

The sets are still woefully incomplete so a lot of pages are missing, as they are written during short downtime periods. They will also be expended as features and new idioms are accumulated in the engine over time.

Check the tests/exercises in the main codebase to cheat on solving the different extercises.

Beginner

Exercise 1: Hello Image

The first exercise set introduces you to loading and displaying images, text and single- coloured regions, along with first level debugging tools.

Exercise 2: Transforming

The second exercise set introduces you to transformation chains: scaling, rotation, blending and how they interact with interpolation.

Exercise 3: Getting Control and keeping Time

The third exercise set takes care of the necessary evil behind getting access to input devices and the timing sources available.

Exercise 4: Meet the Family

The fourth exercise set works through how video objects can be connected to each-other and which rules and caveats that apply.

Exercise 5: Sharing is Caring

The fifth exercise set goes into how objects can share backing store with each other as a means for saving memory and making drawing more cache friendly.

Exercise 6: Who, What, Where

The sixth exercise set goes into object picking.

Exercise 7: Commmand- decode

The seventh exercise set takes you into the first round of attaching external dynamic data sources and sinks.

Exercise 8: Can you Hear that?

The eigth exercise set works on basic audio controls and playback.

Intermediate

Exercise 1: Target for rendering

Now the gloves are coming off as the basics are in place. The first intermediate exercise set is that of rendertargets.

Exercise 2: 50 Shaders of Grey

The second exercise set brings up the deep topic of 'shaders', GPU accelerated processing.

Exercise 3: Serve me Up

The third exercise set dives deeper into the the frameservers concept.

Exercise 4: Get the Point

The fourth exercise set gets into how 'connection points' can serve as an alternate way of hooking up clients.

Exercise 5: Sampling and Filtering

The fourth exercise set dives into image quality controls.

Exercise 6: Stacked, Know your Limits

The fifth exercise set is about the context stack, and how it relates to resource management.

Exercise 7: The third Dimensions

The sixth exercise set looks at the basic set of engine features that can be used for rendering 3D scenes.

Exercise 7: A record for future generations

The seventh exercise set returns to the frameserver concept and shows how recordtargets are used for reading back.

Exercise 8: Debugging tools and Crash Recovery

The eight exercise set digs into built-in scripts, engine features etc. useful to discover problems.

Exercise 9: It's terminal

This ninth exercise set continues the frameserver track by introducing the terminal/CLI.

Advanced

Exercise 1: Target Acquired

The first advanced exercise set looks into how frameserver connections are made, special controls and the difference between authoritative and non-authoritative connections.

Exercise 2: Multiple Segments

The third exercise set expands on the frameserver idea, and covers how additional segments can be requested and (rejected or pushed) to an existing frameserver, and what this is used for.

Exercise 3: State of Mind

The fourth exercise set covers frameserver state-management, what events to look out for and how state can be explicitly pushed between frameservers.

Exercise 4: Arcan-in-Arcan

The fifth exercise set covers the special LWA (lightweight-) Arcan build where Arcan can be used as an application engine and as a display server.

Exercise 5: Being Calculated

The sixth exercise set digs into other special forms of rendertargets, such as calctargets and nulltargets.

Exercise 6: Display Management

The seventh exercise set covers low level display management controls.

Exercise 7: Networking

The eight exercise set goes into building networked applications and using the supporting networking tools.

Exercise 8: History Trail

The second exercise set looks how an odd but potent combination of engine features can be used to compare frameserver data against older iterations of itself.

Exercise 9: Texting

The nineth exercise set goes into external text user interfaces using the Lua bindings for the TUI API.

Low-level

Exercise 1: Prrrrr TUI

This exercise set takes us into setting up, writing and attaching external text clients using the C TUI API.

Exercise 2: Hello SHMIF World

The low level excursion starts by dipping into writing your own external clients that can connect, draw and respond to inputs.

Exercise 3: All the Events

This set expands on the set of possible ingoing and outgoing events.

Exercise 4: A segmented future

This adds support for multiple outputs both by volition and by force.

Exercise 5: Accelerating SHMIF

This expands a shmif context into using OpenGL, as well as re-using the 'AGP' layer from the arcan engine for lighter 3D graphics.

Exercise 6: Serving SHMIF

This detracts from using arcan as a host for shmif clients and instead writes a server of your own.

Clone this wiki locally