2018-08-17 06:09:53 +00:00
|
|
|
#pragma once
|
2018-05-05 19:38:55 +00:00
|
|
|
|
2018-05-11 14:39:28 +00:00
|
|
|
#include "gl.h"
|
|
|
|
|
|
|
|
__BEGIN_DECLS
|
|
|
|
|
2018-08-07 19:22:44 +00:00
|
|
|
/*
|
|
|
|
* Dreamcast specific compressed + twiddled formats.
|
|
|
|
* We use constants from the range 0xEEE0 onwards
|
|
|
|
* to avoid trampling any real GL constants (this is in the middle of the
|
|
|
|
* any_vendor_future_use range defined in the GL enum.spec file.
|
|
|
|
*/
|
|
|
|
#define GL_UNSIGNED_SHORT_5_6_5_TWID_KOS 0xEEE0
|
|
|
|
#define GL_UNSIGNED_SHORT_1_5_5_5_REV_TWID_KOS 0xEEE2
|
|
|
|
#define GL_UNSIGNED_SHORT_4_4_4_4_REV_TWID_KOS 0xEEE3
|
|
|
|
|
|
|
|
#define GL_COMPRESSED_RGB_565_VQ_KOS 0xEEE4
|
|
|
|
#define GL_COMPRESSED_ARGB_1555_VQ_KOS 0xEEE6
|
|
|
|
#define GL_COMPRESSED_ARGB_4444_VQ_KOS 0xEEE7
|
|
|
|
|
|
|
|
#define GL_COMPRESSED_RGB_565_VQ_TWID_KOS 0xEEE8
|
|
|
|
#define GL_COMPRESSED_ARGB_1555_VQ_TWID_KOS 0xEEEA
|
|
|
|
#define GL_COMPRESSED_ARGB_4444_VQ_TWID_KOS 0xEEEB
|
|
|
|
|
2018-08-08 08:50:57 +00:00
|
|
|
#define GL_COMPRESSED_RGB_565_VQ_MIPMAP_KOS 0xEEEC
|
|
|
|
#define GL_COMPRESSED_ARGB_1555_VQ_MIPMAP_KOS 0xEEED
|
|
|
|
#define GL_COMPRESSED_ARGB_4444_VQ_MIPMAP_KOS 0xEEEE
|
|
|
|
|
|
|
|
#define GL_COMPRESSED_RGB_565_VQ_MIPMAP_TWID_KOS 0xEEEF
|
|
|
|
#define GL_COMPRESSED_ARGB_1555_VQ_MIPMAP_TWID_KOS 0xEEF0
|
|
|
|
#define GL_COMPRESSED_ARGB_4444_VQ_MIPMAP_TWID_KOS 0xEEF1
|
|
|
|
|
2018-08-07 19:22:44 +00:00
|
|
|
#define GL_NEARZ_CLIPPING_KOS 0xEEFA
|
2018-08-01 10:32:07 +00:00
|
|
|
|
2019-03-03 18:49:33 +00:00
|
|
|
#define GL_UNSIGNED_BYTE_TWID_KOS 0xEEFB
|
|
|
|
|
2018-05-20 20:28:48 +00:00
|
|
|
|
2019-03-11 19:07:59 +00:00
|
|
|
/* Initialize the GL pipeline. GL will initialize the PVR. */
|
|
|
|
GLAPI void APIENTRY glKosInit();
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
/* If GL_TRUE, enables pvr autosorting, this *will* break glDepthFunc/glDepthTest */
|
|
|
|
GLboolean autosort_enabled;
|
|
|
|
|
|
|
|
/* The internal format for paletted textures, must be GL_RGBA4 (default) or GL_RGBA8 */
|
|
|
|
GLenum internal_palette_format;
|
|
|
|
|
|
|
|
/* Initial capacity of each of the OP, TR and PT lists in vertices */
|
2019-03-13 15:43:50 +00:00
|
|
|
GLuint initial_op_capacity;
|
|
|
|
GLuint initial_tr_capacity;
|
|
|
|
GLuint initial_pt_capacity;
|
|
|
|
GLuint initial_immediate_capacity;
|
2019-03-11 19:07:59 +00:00
|
|
|
} GLdcConfig;
|
2018-05-11 14:39:28 +00:00
|
|
|
|
2018-08-07 19:22:44 +00:00
|
|
|
|
2019-09-30 08:14:43 +00:00
|
|
|
typedef struct {
|
|
|
|
GLuint padding0;
|
|
|
|
GLfloat x;
|
|
|
|
GLfloat y;
|
|
|
|
GLfloat z;
|
|
|
|
GLfloat u;
|
|
|
|
GLfloat v;
|
2019-09-30 20:59:11 +00:00
|
|
|
GLubyte bgra[4];
|
2019-09-30 08:14:43 +00:00
|
|
|
GLuint padding1;
|
|
|
|
} GLVertexKOS;
|
|
|
|
|
|
|
|
GLAPI void APIENTRY glVertexPackColor3fKOS(GLVertexKOS* vertex, float r, float g, float b);
|
|
|
|
GLAPI void APIENTRY glVertexPackColor4fKOS(GLVertexKOS* vertex, float r, float g, float b, float a);
|
|
|
|
|
2019-03-11 19:07:59 +00:00
|
|
|
GLAPI void APIENTRY glKosInitConfig(GLdcConfig* config);
|
|
|
|
|
|
|
|
/* Usage:
|
|
|
|
*
|
|
|
|
* GLdcConfig config;
|
|
|
|
* glKosInitConfig(&config);
|
|
|
|
*
|
|
|
|
* config.autosort_enabled = GL_TRUE;
|
|
|
|
*
|
|
|
|
* glKosInitEx(&config);
|
|
|
|
*/
|
|
|
|
GLAPI void APIENTRY glKosInitEx(GLdcConfig* config);
|
|
|
|
GLAPI void APIENTRY glKosSwapBuffers();
|
|
|
|
|
2019-03-10 11:18:56 +00:00
|
|
|
/*
|
|
|
|
* CUSTOM EXTENSION multiple_shared_palette_KOS
|
|
|
|
*
|
|
|
|
* This extension allows using up to 4 different shared palettes
|
|
|
|
* with ColorTableEXT. The following constants are provided
|
|
|
|
* to use as targets for ColorTableExt:
|
|
|
|
*
|
|
|
|
* - SHARED_TEXTURE_PALETTE_0_KOS
|
|
|
|
* - SHARED_TEXTURE_PALETTE_1_KOS
|
|
|
|
* - SHARED_TEXTURE_PALETTE_2_KOS
|
|
|
|
* - SHARED_TEXTURE_PALETTE_3_KOS
|
|
|
|
*
|
|
|
|
* In this use case SHARED_TEXTURE_PALETTE_0_KOS is interchangable with SHARED_TEXTURE_PALETTE_EXT
|
|
|
|
* (both refer to the first shared palette).
|
|
|
|
*
|
|
|
|
* To select which palette a texture uses, a new pname is accepted by TexParameteri: SHARED_TEXTURE_BANK_KOS
|
|
|
|
* by default textures use shared palette 0.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define GL_SHARED_TEXTURE_PALETTE_0_KOS 0xEEFC
|
|
|
|
#define GL_SHARED_TEXTURE_PALETTE_1_KOS 0xEEFD
|
|
|
|
#define GL_SHARED_TEXTURE_PALETTE_2_KOS 0xEEFE
|
|
|
|
#define GL_SHARED_TEXTURE_PALETTE_3_KOS 0xEEFF
|
|
|
|
|
|
|
|
/* Pass to glTexParameteri to set the shared bank */
|
|
|
|
#define GL_SHARED_TEXTURE_BANK_KOS 0xEF00
|
2018-05-20 15:16:53 +00:00
|
|
|
|
2018-05-11 14:39:28 +00:00
|
|
|
__END_DECLS
|
2018-05-05 19:38:55 +00:00
|
|
|
|