Oblivision
A simple UI library rendered directly from a pixel buffer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
oblivision.h File Reference

header for the Oblivision API. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdint.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
#include "colors.h"

Go to the source code of this file.

Classes

struct  color_s
 
struct  vec2_s
 
struct  windata
 Main structure for managing all pixel data, textures, sizes, etc. More...
 
struct  widget_data
 Structure to hold all widget(OV window) data. More...
 

Macros

#define SDL_MAIN_HANDLED
 
#define OV_DEBUG_ENABLE   1
 
#define MAXWID   7680
 
#define MAXHEI   4320
 
#define MAX_WIGS   256
 

Typedefs

typedef struct color_s OV_COLOR
 A "non-proprietary" typedef holding colordata.
 
typedef struct vec2_s vec2
 Vector data for things like window position/sizes.
 

Functions

void OV_colorTest ()
 Runs a simple color tester.
 
void OV_setBackground (OV_COLOR bg_color)
 Sets the background color of your Oblivision window.
 
int OV_createWindow (int width, int height, vec2 pos, const char *name)
 Initializes and creates an Oblivision window.
 
void OV_pollEvent (SDL_Event event)
 runs the SDL event poll loop to register key events and update window positions
 
void OV_renderFrame (SDL_Event event)
 
void OV_setFlags (int flag)
 
void OV_setFont (const char *font)
 
int OVInit (SDL_Window *window, int width, int height, const char *winname)
 
void OV_free ()
 

Detailed Description

header for the Oblivision API.

Author
Tristan Wellman

Function Documentation

◆ OV_colorTest()

void OV_colorTest ( )

Runs a simple color tester.

Note
Oblivision should be initialized prior to OV_colorTest()

◆ OV_createWindow()

int OV_createWindow ( int  width,
int  height,
vec2  pos,
const char *  name 
)

Initializes and creates an Oblivision window.

Note
Oblivision should be initialized prior to OV_createWindow
Parameters
widththe desired width of the window
heightthe desired height of the window
posvector holding the x & y position for the OV window;
namename initialized as an ID with the window

◆ OV_pollEvent()

void OV_pollEvent ( SDL_Event  event)

runs the SDL event poll loop to register key events and update window positions

Note
Requires an initialized & running session of Oblivision.
Parameters
eventSDL_Event used to poll key & mouse events as well as positions

◆ OV_setBackground()

void OV_setBackground ( OV_COLOR  bg_color)

Sets the background color of your Oblivision window.

Parameters
bg_colorthe RGBA8888 color set for the background