mirror of
https://github.com/ScrelliCopter/Lesson10-SDL3.git
synced 2025-02-21 07:19:26 +11:00
format pass
This commit is contained in:
16
Lesson10.cpp
16
Lesson10.cpp
@@ -111,8 +111,10 @@ void SetupWorld()
|
||||
|
||||
bool FlipSurface(SDL_Surface *surface)
|
||||
{
|
||||
if (!surface) return false;
|
||||
if (SDL_LockSurface(surface) < 0) return false;
|
||||
if (!surface || SDL_LockSurface(surface) < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const int pitch = surface->pitch;
|
||||
const int numrows = surface->h;
|
||||
@@ -210,7 +212,7 @@ GLvoid ReSizeGLScene(GLsizei width, GLsizei height) // Resize And Initialize Th
|
||||
glLoadIdentity(); // Reset The Modelview Matrix
|
||||
}
|
||||
|
||||
int InitGL(GLvoid) // All Setup For OpenGL Goes Here
|
||||
int InitGL() // All Setup For OpenGL Goes Here
|
||||
{
|
||||
if (!LoadGLTextures()) // Jump To Texture Loading Routine
|
||||
{
|
||||
@@ -231,7 +233,7 @@ int InitGL(GLvoid) // All Setup For OpenGL Goes Here
|
||||
return 1; // Initialization Went OK
|
||||
}
|
||||
|
||||
int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing
|
||||
int DrawGLScene() // Here's Where We Do All The Drawing
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
|
||||
glLoadIdentity(); // Reset The View
|
||||
@@ -244,8 +246,8 @@ int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing
|
||||
|
||||
int numtriangles;
|
||||
|
||||
glRotatef(lookupdown,1.0f,0,0);
|
||||
glRotatef(sceneroty,0,1.0f,0);
|
||||
glRotatef(lookupdown, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef(sceneroty, 0.0f, 1.0f, 0.0f);
|
||||
|
||||
glTranslatef(xtrans, ytrans, ztrans);
|
||||
glBindTexture(GL_TEXTURE_2D, texture[filter]);
|
||||
@@ -282,7 +284,7 @@ int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing
|
||||
return 1; // Everything Went OK
|
||||
}
|
||||
|
||||
GLvoid KillGLWindow(GLvoid) // Properly Kill The Window
|
||||
GLvoid KillGLWindow() // Properly Kill The Window
|
||||
{
|
||||
if (fullscreen) // Are We In Fullscreen Mode?
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user