Allow enabling fsaa via the GLdcConfig struct

This commit is contained in:
Luke Benstead 2020-03-18 20:47:12 +00:00
parent 71c25829f1
commit 03bc758be7
4 changed files with 16 additions and 5 deletions

View File

@ -39,13 +39,13 @@ static void pvr_list_submit(void *src, int n) {
d[0] = d[8] = 0;
}
static void _glInitPVR(GLboolean autosort) {
static void _glInitPVR(GLboolean autosort, GLboolean fsaa) {
pvr_init_params_t params = {
/* Enable opaque and translucent polygons with size 32 and 32 */
{PVR_BINSIZE_32, PVR_BINSIZE_0, PVR_BINSIZE_32, PVR_BINSIZE_0, PVR_BINSIZE_32},
PVR_VERTEX_BUF_SIZE, /* Vertex buffer size */
0, /* No DMA */
0, /* No FSAA */
fsaa, /* No FSAA */
(autosort) ? 0 : 1 /* Disable translucent auto-sorting to match traditional GL */
};
@ -78,6 +78,8 @@ void APIENTRY glFinish() {
void APIENTRY glKosInitConfig(GLdcConfig* config) {
config->autosort_enabled = GL_FALSE;
config->fsaa_enabled = GL_FALSE;
config->initial_op_capacity = 1024;
config->initial_pt_capacity = 512;
config->initial_tr_capacity = 1024;
@ -90,7 +92,7 @@ void APIENTRY glKosInitEx(GLdcConfig* config) {
printf("\nWelcome to GLdc! Git revision: %s\n\n", GLDC_VERSION);
_glInitPVR(config->autosort_enabled);
_glInitPVR(config->autosort_enabled, config->fsaa_enabled);
_glInitMatrices();
_glInitAttributePointers();

View File

@ -1,2 +1,3 @@
#pragma once
#define GLDC_VERSION "1.1-master"
#define GLDC_VERSION "1.1-102-g71c25-dirty"

View File

@ -42,6 +42,9 @@ typedef struct {
/* If GL_TRUE, enables pvr autosorting, this *will* break glDepthFunc/glDepthTest */
GLboolean autosort_enabled;
/* If GL_TRUE, enables the PVR FSAA */
GLboolean fsaa_enabled;
/* The internal format for paletted textures, must be GL_RGBA4 (default) or GL_RGBA8 */
GLenum internal_palette_format;

View File

@ -283,7 +283,12 @@ void DrawGLScene()
int main(int argc, char **argv)
{
glKosInit();
GLdcConfig config;
glKosInitConfig(&config);
config.fsaa_enabled = GL_TRUE;
glKosInitEx(&config);
InitGL(640, 480);
ReSizeGLScene(640, 480);