Created Graphics API (markdown)

UnknownShadow200 2017-02-11 13:46:46 +11:00
parent efe513a995
commit ee87a81eaa

30
Graphics-API.md Normal file

@ -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).