Kore
Loading...
Searching...
No Matches
graphics.h File Reference

Supports a very basic pixel-setting API. More...

#include <kinc/global.h>
#include <kinc/color.h>
#include <assert.h>

Go to the source code of this file.

Enumerations

enum  kinc_g1_texture_filter_t { KINC_G1_TEXTURE_FILTER_POINT , KINC_G1_TEXTURE_FILTER_LINEAR , KINC_G1_TEXTURE_FILTER_ANISOTROPIC }
enum  kinc_g1_mipmap_filter_t { KINC_G1_MIPMAP_FILTER_NONE , KINC_G1_MIPMAP_FILTER_POINT , KINC_G1_MIPMAP_FILTER_LINEAR }

Functions

KINC_FUNC void kinc_g1_init (int width, int height)
 Initializes the G1-API.
KINC_FUNC void kinc_g1_begin (void)
 Typically called once per frame before other G1-functions are called.
KINC_FUNC void kinc_g1_end (void)
 Typically called once per frame after all G1-drawing is finished. This also swaps the framebuffers so an equivalent call to kinc_g4_swap_buffers is not needed.
KINC_FUNC void kinc_g1_set_pixel (int x, int y, float red, float green, float blue)
 Sets a single pixel to a color.
KINC_FUNC int kinc_g1_width (void)
 Returns the width used by G1.
KINC_FUNC int kinc_g1_height (void)
 Returns the height used by G1.
KINC_FUNC void kinc_g1_set_texture_magnification_filter (kinc_g1_texture_filter_t filter)
 Set the texture-sampling-mode for upscaled textures.
KINC_FUNC void kinc_g1_set_texture_minification_filter (kinc_g1_texture_filter_t filter)
 Set the texture-sampling-mode for downscaled textures.
KINC_FUNC void kinc_g1_set_texture_mipmap_filter (kinc_g1_mipmap_filter_t filter)
 Sets the mipmap-sampling-mode which defines whether mipmaps are used at all and if so whether the two neighbouring mipmaps are linearly interpolated.

Detailed Description

Supports a very basic pixel-setting API.

Function Documentation

◆ kinc_g1_height()

KINC_FUNC int kinc_g1_height ( void )

Returns the height used by G1.

Returns
The height

◆ kinc_g1_init()

KINC_FUNC void kinc_g1_init ( int width,
int height )

Initializes the G1-API.

Parameters
widthThe width to be used by the G1-API - typically the window-width
heightThe height to be used by the G1-API - typically the window-height

◆ kinc_g1_set_pixel()

KINC_FUNC void kinc_g1_set_pixel ( int x,
int y,
float red,
float green,
float blue )

Sets a single pixel to a color.

Parameters
xThe x-component of the pixel-coordinate to set
yThe y-component of the pixel-coordinate to set
redThe red-component between 0 and 1
greenThe green-component between 0 and 1
blueThe blue-component between 0 and 1

◆ kinc_g1_set_texture_magnification_filter()

KINC_FUNC void kinc_g1_set_texture_magnification_filter ( kinc_g1_texture_filter_t filter)

Set the texture-sampling-mode for upscaled textures.

Parameters
unitThe texture-unit to set the texture-sampling-mode for
filterThe mode to set

◆ kinc_g1_set_texture_minification_filter()

KINC_FUNC void kinc_g1_set_texture_minification_filter ( kinc_g1_texture_filter_t filter)

Set the texture-sampling-mode for downscaled textures.

Parameters
unitThe texture-unit to set the texture-sampling-mode for
filterThe mode to set

◆ kinc_g1_set_texture_mipmap_filter()

KINC_FUNC void kinc_g1_set_texture_mipmap_filter ( kinc_g1_mipmap_filter_t filter)

Sets the mipmap-sampling-mode which defines whether mipmaps are used at all and if so whether the two neighbouring mipmaps are linearly interpolated.

Parameters
unitThe texture-unit to set the mipmap-sampling-mode for
filterThe mode to set

◆ kinc_g1_width()

KINC_FUNC int kinc_g1_width ( void )

Returns the width used by G1.

Returns
The width