-
Notifications
You must be signed in to change notification settings - Fork 0
InitCR
Kay Steinhoff edited this page Oct 7, 2024
·
3 revisions
bool InitCR (unsigned int width,
unsigned int height,
CR_RENDER_BUFFER_TYPE bufferType,
float fov,
float nearPlane,
float farPlane)
The width of the rendered image(the viewport if you will) as an integer. unsigned to prevent negative values.
The height of the rendered image(the viewport if you will) as an integer. unsigned to prevent negative values.
A enum value from the CR_RENDER_BUFFER_TYPE enum to indicate the bit depth of the render target (24 or 32 bit)
The field of view in degrees. Used to create the projection matrix.
The near plane(the closest point to the camera for a vertex), normally set to a value near or below 0.1.
The furthest point a vertex can be from the camera and still be rendered. Normally set to 1000 or above.
#include <stdio.h>
#include <cr.h>
int main(void)
{
if(!InitCR(800, 600, CR_RGBA, 90, 0.1, 1000))
{
printf("Failed to initialize cr!\n");
return -1;
}
return 0;
}