From ee87a81eaadd51047e35c26ccc45502e6c1758eb Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 11 Feb 2017 13:46:46 +1100 Subject: [PATCH] Created Graphics API (markdown) --- Graphics-API.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Graphics-API.md diff --git a/Graphics-API.md b/Graphics-API.md new file mode 100644 index 0000000..be67cb0 --- /dev/null +++ b/Graphics-API.md @@ -0,0 +1,30 @@ +IGraphicsAPI (accessed usually via game.Graphics) is a simplistic low level abstraction of 3D graphics hardware. + +**There are no fancy shaders, objects, framebuffers, etc.** + +Built-in implementations of IGraphicsAPI include Direct3D 9, OpenGL (1.5, or 1.2 with ARB_vertex_buffer_object), and OpenGL ES 1.1. + + +*** +### Textures +**Note**: The only supported bitmap formats are 32 bits per pixel, with power of two dimensions. + +**`MaxTextureDimensions`** - Gets the maximum supported dimension size (i.e. width and height) for a texture. + +**`Texturing`** - Sets whether texturing is used when drawing/rasterizing. **It is extremely important that you enable this before drawing textured vertices, and disable it afterwards.** + +**`CreateTexture(source)`** - Creates a new native texture from a Bitmap or FastBitmap object, returning its id. This id is used in all other texture related methods. + +**`BindTexture(id)`** - Sets the active texture used for drawing/rasterization. + +**`DeleteTexture(id)`** - Deletes the native texture with that id, and resets id to -1. + +**`UpdateTexturePart(id, x, y, part)`** - Fills the region (x, y, part.Width, part.Height) in the native texture with that id, with the pixels from part. +_Note on OpenGL backends, this also changes the active texture to id._ +*** +### Vertices +**Note**: The only supported formats are (XYZ float32, ARGB uint8) and (XYZ float32, ARGB uint8, UV float32). + +**Note**: The actual order of ARGB components differs depending on the underlying implementation, use FastColour.Pack() to pack a colour into the correct order. + +**Note**: The only supported drawing modes are triangles, lines, and indexed triangles (i.e. quads). \ No newline at end of file