Goals:
- support vsynced double and triple buffering
- zero buffer copies
User space execution flow:
- block on free_queue.size() > 0
- lock free_queue, remove top element, unlock
- acquire buffer handle
- map buffer into virtual memory region
- draw into buffer
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class MobSpawner : MonoBehaviour | |
| { | |
| public class Trap | |
| { | |
| private static int ordinal = 0; | |
| class GameObject { } | |
| class ElementSpec | |
| { | |
| public int ID; | |
| public EffectType type; | |
| public string effectName; | |
| public GameObject turretToSpawn; | |
| public GameObject magicForPlayer; |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace Test | |
| { | |
| enum EffectType | |
| { |
| class EffectList | |
| { | |
| class EffectTimer | |
| { | |
| public EffectType type; | |
| public float timer; | |
| }; | |
| private List<EffectTimer> effects; |
Goals:
User space execution flow:
| void init() // once | |
| { | |
| constexpr int WIDTH = XXX; | |
| constexpr int HEIGHT = XXX; | |
| SDL_Surface* _output = SDL_CreateRGBSurface(0, WIDTH, HEIGHT, 32, format->Rmask, format->Gmask, format->Bmask, format->Amask); | |
| SDL_Texture* _outputTexture = SDL_CreateTexture(renderer, format->format, SDL_TEXTUREACCESS_STREAMING, WIDTH, HEIGHT); | |
| SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); | |
| } |
| #include "SDL.h" | |
| #include <cstdio> | |
| #include <cstdlib> | |
| #include <cassert> | |
| #include <array> | |
| int main(int argc, const char* argv[]) | |
| { |
| using System; | |
| using System.IO; | |
| using System.Text; | |
| namespace gcm_nasos_deux | |
| { | |
| class Program | |
| { | |
| struct gcm_info | |
| { |
| #include <cstdio> | |
| #include <cstdlib> | |
| #include <iostream> | |
| using byte = uint8_t; | |
| int main(int argc, const char* argv[]) | |
| { | |
| if (argc == 2) | |
| { |