Merge branch 'deinit_fix' into 'master'
Allow for proper shutdown/deinitialization See merge request simulant/GLdc!165
This commit is contained in:
commit
e61ffaede1
@ -103,6 +103,9 @@ void APIENTRY glKosShutdown() {
|
||||
aligned_vector_clear(&OP_LIST.vector);
|
||||
aligned_vector_clear(&PT_LIST.vector);
|
||||
aligned_vector_clear(&TR_LIST.vector);
|
||||
|
||||
ShutdownGPU();
|
||||
_initialized = false;
|
||||
}
|
||||
|
||||
void APIENTRY glKosInit() {
|
||||
|
||||
@ -53,6 +53,10 @@ void InitGPU(_Bool autosort, _Bool fsaa) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void ShutdownGPU() {
|
||||
pvr_shutdown();
|
||||
}
|
||||
|
||||
GL_FORCE_INLINE float _glFastInvert(float x) {
|
||||
return (1.0f / __builtin_sqrtf(x * x));
|
||||
}
|
||||
|
||||
@ -160,6 +160,8 @@ GL_FORCE_INLINE void TransformVertex(float x, float y, float z, float w, float*
|
||||
|
||||
void InitGPU(_Bool autosort, _Bool fsaa);
|
||||
|
||||
void ShutdownGPU();
|
||||
|
||||
static inline size_t GPUMemoryAvailable() {
|
||||
return pvr_mem_available();
|
||||
}
|
||||
|
||||
@ -54,6 +54,22 @@ void InitGPU(_Bool autosort, _Bool fsaa) {
|
||||
aligned_vector_init(&vbuffer, sizeof(SDL_Vertex));
|
||||
}
|
||||
|
||||
void ShutdownGPU() {
|
||||
aligned_vector_clear(&vbuffer);
|
||||
|
||||
if (RENDERER) {
|
||||
SDL_DestroyRenderer(RENDERER);
|
||||
RENDERER = NULL;
|
||||
}
|
||||
|
||||
if (WINDOW) {
|
||||
SDL_DestroyWindow(WINDOW);
|
||||
WINDOW = NULL;
|
||||
}
|
||||
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
void SceneBegin() {
|
||||
SDL_SetRenderDrawColor(RENDERER, BACKGROUND_COLOR[0], BACKGROUND_COLOR[1], BACKGROUND_COLOR[2], 0);
|
||||
SDL_RenderClear(RENDERER);
|
||||
|
||||
@ -54,6 +54,7 @@ static inline void TransformNormalNoMod(const float* xIn, float* xOut) {
|
||||
void TransformVertex(float x, float y, float z, float w, float* oxyz, float* ow);
|
||||
|
||||
void InitGPU(_Bool autosort, _Bool fsaa);
|
||||
void ShutdownGPU();
|
||||
|
||||
enum GPUPaletteFormat;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user