Updated some comments
This commit is contained in:
parent
a42f8328b2
commit
8e186e840c
6 changed files with 57 additions and 57 deletions
|
@ -116,7 +116,7 @@ void InitAudioDevice()
|
||||||
TraceLog(ERROR, "Could not setup audio context");
|
TraceLog(ERROR, "Could not setup audio context");
|
||||||
}
|
}
|
||||||
|
|
||||||
TraceLog(INFO, "Audio device and context initialized: %s\n", alcGetString(device, ALC_DEVICE_SPECIFIER));
|
TraceLog(INFO, "Audio device and context initialized successfully: %s\n", alcGetString(device, ALC_DEVICE_SPECIFIER));
|
||||||
|
|
||||||
// Listener definition (just for 2D)
|
// Listener definition (just for 2D)
|
||||||
alListener3f(AL_POSITION, 0, 0, 0);
|
alListener3f(AL_POSITION, 0, 0, 0);
|
||||||
|
|
80
src/models.c
80
src/models.c
|
@ -285,29 +285,29 @@ void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color
|
||||||
rlBegin(RL_TRIANGLES);
|
rlBegin(RL_TRIANGLES);
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||||
|
|
||||||
for(int i = 0; i < 2 * rings + 1; i++)
|
for(int i = 0; i < 2 * rings + (rings / 3); i++)
|
||||||
{
|
{
|
||||||
for(int j = 0; j < slices; j++)
|
for(int j = 0; j < slices; j++)
|
||||||
{
|
{
|
||||||
rlVertex3f(cos(DEG2RAD*(270+(90/rings)*i)) * sin(DEG2RAD*(j*360/slices)) * radius,
|
rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i)) * sin(DEG2RAD*(j*360/slices)),
|
||||||
sin(DEG2RAD*(270+(90/rings)*i)) * radius,
|
sin(DEG2RAD*(270+(180/(rings + 1))*i)),
|
||||||
cos(DEG2RAD*(270+(90/rings)*i)) * cos(DEG2RAD*(j*360/slices)) * radius);
|
cos(DEG2RAD*(270+(180/(rings + 1))*i)) * cos(DEG2RAD*(j*360/slices)));
|
||||||
rlVertex3f(cos(DEG2RAD*(270+(90/rings)*(i+1))) * sin(DEG2RAD*((j+1)*360/slices)) * radius,
|
rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*((j+1)*360/slices)),
|
||||||
sin(DEG2RAD*(270+(90/rings)*(i+1))) * radius,
|
sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))),
|
||||||
cos(DEG2RAD*(270+(90/rings)*(i+1))) * cos(DEG2RAD*((j+1)*360/slices)) * radius);
|
cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*((j+1)*360/slices)));
|
||||||
rlVertex3f(cos(DEG2RAD*(270+(90/rings)*(i+1))) * sin(DEG2RAD*(j*360/slices)) * radius,
|
rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*(j*360/slices)),
|
||||||
sin(DEG2RAD*(270+(90/rings)*(i+1))) * radius,
|
sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))),
|
||||||
cos(DEG2RAD*(270+(90/rings)*(i+1))) * cos(DEG2RAD*(j*360/slices)) * radius);
|
cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*(j*360/slices)));
|
||||||
|
|
||||||
rlVertex3f(cos(DEG2RAD*(270+(90/rings)*i)) * sin(DEG2RAD*(j*360/slices)) * radius,
|
rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i)) * sin(DEG2RAD*(j*360/slices)),
|
||||||
sin(DEG2RAD*(270+(90/rings)*i)) * radius,
|
sin(DEG2RAD*(270+(180/(rings + 1))*i)),
|
||||||
cos(DEG2RAD*(270+(90/rings)*i)) * cos(DEG2RAD*(j*360/slices)) * radius);
|
cos(DEG2RAD*(270+(180/(rings + 1))*i)) * cos(DEG2RAD*(j*360/slices)));
|
||||||
rlVertex3f(cos(DEG2RAD*(270+(90/rings)*(i))) * sin(DEG2RAD*((j+1)*360/slices)) * radius,
|
rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i))) * sin(DEG2RAD*((j+1)*360/slices)),
|
||||||
sin(DEG2RAD*(270+(90/rings)*(i))) * radius,
|
sin(DEG2RAD*(270+(180/(rings + 1))*(i))),
|
||||||
cos(DEG2RAD*(270+(90/rings)*(i))) * cos(DEG2RAD*((j+1)*360/slices)) * radius);
|
cos(DEG2RAD*(270+(180/(rings + 1))*(i))) * cos(DEG2RAD*((j+1)*360/slices)));
|
||||||
rlVertex3f(cos(DEG2RAD*(270+(90/rings)*(i+1))) * sin(DEG2RAD*((j+1)*360/slices)) * radius,
|
rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*((j+1)*360/slices)),
|
||||||
sin(DEG2RAD*(270+(90/rings)*(i+1))) * radius,
|
sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))),
|
||||||
cos(DEG2RAD*(270+(90/rings)*(i+1))) * cos(DEG2RAD*((j+1)*360/slices)) * radius);
|
cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*((j+1)*360/slices)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rlEnd();
|
rlEnd();
|
||||||
|
@ -318,37 +318,37 @@ void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color
|
||||||
void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color)
|
void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color)
|
||||||
{
|
{
|
||||||
rlPushMatrix();
|
rlPushMatrix();
|
||||||
//rlTranslatef(centerPos.x, centerPos.y, centerPos.z);
|
rlTranslatef(centerPos.x, centerPos.y, centerPos.z);
|
||||||
rlScalef(radius, radius, radius);
|
//rlScalef(radius, radius, radius);
|
||||||
//rlRotatef(rotation, 0, 1, 0);
|
//rlRotatef(rotation, 0, 1, 0);
|
||||||
|
|
||||||
rlBegin(RL_LINES);
|
rlBegin(RL_LINES);
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||||
|
|
||||||
for(int i = 0; i < 2 * rings + 1; i++)
|
for(int i = 0; i < (rings + 2); i++)
|
||||||
{
|
{
|
||||||
for(int j = 0; j < slices; j++)
|
for(int j = 0; j < slices; j++)
|
||||||
{
|
{
|
||||||
rlVertex3f(cos(DEG2RAD*(270+(90/rings)*i)) * sin(DEG2RAD*(j*360/slices)) * radius,
|
rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i)) * sin(DEG2RAD*(j*360/slices)) * radius,
|
||||||
sin(DEG2RAD*(270+(90/rings)*i)) * radius,
|
sin(DEG2RAD*(270+(180/(rings + 1))*i)) * radius,
|
||||||
cos(DEG2RAD*(270+(90/rings)*i)) * cos(DEG2RAD*(j*360/slices)) * radius);
|
cos(DEG2RAD*(270+(180/(rings + 1))*i)) * cos(DEG2RAD*(j*360/slices)) * radius);
|
||||||
rlVertex3f(cos(DEG2RAD*(270+(90/rings)*(i+1))) * sin(DEG2RAD*((j+1)*360/slices)) * radius,
|
rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*((j+1)*360/slices)) * radius,
|
||||||
sin(DEG2RAD*(270+(90/rings)*(i+1))) * radius,
|
sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * radius,
|
||||||
cos(DEG2RAD*(270+(90/rings)*(i+1))) * cos(DEG2RAD*((j+1)*360/slices)) * radius);
|
cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*((j+1)*360/slices)) * radius);
|
||||||
|
|
||||||
rlVertex3f(cos(DEG2RAD*(270+(90/rings)*(i+1))) * sin(DEG2RAD*((j+1)*360/slices)) * radius,
|
rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*((j+1)*360/slices)) * radius,
|
||||||
sin(DEG2RAD*(270+(90/rings)*(i+1))) * radius,
|
sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * radius,
|
||||||
cos(DEG2RAD*(270+(90/rings)*(i+1))) * cos(DEG2RAD*((j+1)*360/slices)) * radius);
|
cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*((j+1)*360/slices)) * radius);
|
||||||
rlVertex3f(cos(DEG2RAD*(270+(90/rings)*(i+1))) * sin(DEG2RAD*(j*360/slices)) * radius,
|
rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*(j*360/slices)) * radius,
|
||||||
sin(DEG2RAD*(270+(90/rings)*(i+1))) * radius,
|
sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * radius,
|
||||||
cos(DEG2RAD*(270+(90/rings)*(i+1))) * cos(DEG2RAD*(j*360/slices)) * radius);
|
cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*(j*360/slices)) * radius);
|
||||||
|
|
||||||
rlVertex3f(cos(DEG2RAD*(270+(90/rings)*(i+1))) * sin(DEG2RAD*(j*360/slices)) * radius,
|
rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*(j*360/slices)) * radius,
|
||||||
sin(DEG2RAD*(270+(90/rings)*(i+1))) * radius,
|
sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * radius,
|
||||||
cos(DEG2RAD*(270+(90/rings)*(i+1))) * cos(DEG2RAD*(j*360/slices)) * radius);
|
cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*(j*360/slices)) * radius);
|
||||||
rlVertex3f(cos(DEG2RAD*(270+(90/rings)*i)) * sin(DEG2RAD*(j*360/slices)) * radius,
|
rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i)) * sin(DEG2RAD*(j*360/slices)) * radius,
|
||||||
sin(DEG2RAD*(270+(90/rings)*i)) * radius,
|
sin(DEG2RAD*(270+(180/(rings + 1))*i)) * radius,
|
||||||
cos(DEG2RAD*(270+(90/rings)*i)) * cos(DEG2RAD*(j*360/slices)) * radius);
|
cos(DEG2RAD*(270+(180/(rings + 1))*i)) * cos(DEG2RAD*(j*360/slices)) * radius);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rlEnd();
|
rlEnd();
|
||||||
|
|
|
@ -221,7 +221,7 @@ typedef struct Camera {
|
||||||
} Camera;
|
} Camera;
|
||||||
|
|
||||||
// Vertex data definning a mesh
|
// Vertex data definning a mesh
|
||||||
typedef struct {
|
typedef struct VertexData {
|
||||||
int vertexCount;
|
int vertexCount;
|
||||||
float *vertices; // 3 components per vertex
|
float *vertices; // 3 components per vertex
|
||||||
float *texcoords; // 2 components per vertex
|
float *texcoords; // 2 components per vertex
|
||||||
|
|
22
src/rlgl.c
22
src/rlgl.c
|
@ -702,7 +702,7 @@ void rlglInit()
|
||||||
TraceLog(ERROR, "Failed to initialize GLEW - Error Code: %s\n", glewGetErrorString(error));
|
TraceLog(ERROR, "Failed to initialize GLEW - Error Code: %s\n", glewGetErrorString(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (glewIsSupported("GL_VERSION_3_3")) TraceLog(INFO, "OpenGL 3.3 initialized\n");
|
if (glewIsSupported("GL_VERSION_3_3")) TraceLog(INFO, "OpenGL 3.3 initialized successfully\n");
|
||||||
|
|
||||||
// Print OpenGL and GLSL version
|
// Print OpenGL and GLSL version
|
||||||
TraceLog(INFO, "Vendor: %s", glGetString(GL_VENDOR));
|
TraceLog(INFO, "Vendor: %s", glGetString(GL_VENDOR));
|
||||||
|
@ -1029,7 +1029,7 @@ void rlglInitGraphicsDevice(int fbWidth, int fbHeight)
|
||||||
// Possible options: GL_SMOOTH (Color interpolation) or GL_FLAT (no interpolation)
|
// Possible options: GL_SMOOTH (Color interpolation) or GL_FLAT (no interpolation)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TraceLog(INFO, "OpenGL graphics device initialized");
|
TraceLog(INFO, "OpenGL Graphics Device initialized successfully");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert image data to OpenGL texture (returns OpenGL valid Id)
|
// Convert image data to OpenGL texture (returns OpenGL valid Id)
|
||||||
|
@ -1313,8 +1313,8 @@ static GLuint LoadDefaultShaders()
|
||||||
glCompileShader(vertexShader);
|
glCompileShader(vertexShader);
|
||||||
glCompileShader(fragmentShader);
|
glCompileShader(fragmentShader);
|
||||||
|
|
||||||
TraceLog(INFO, "[ID %i] Default vertex shader compiled succesfully", vertexShader);
|
TraceLog(INFO, "[ID %i] Default vertex shader compiled successfully", vertexShader);
|
||||||
TraceLog(INFO, "[ID %i] Default fragment shader compiled succesfully", fragmentShader);
|
TraceLog(INFO, "[ID %i] Default fragment shader compiled successfully", fragmentShader);
|
||||||
|
|
||||||
program = glCreateProgram();
|
program = glCreateProgram();
|
||||||
|
|
||||||
|
@ -1326,7 +1326,7 @@ static GLuint LoadDefaultShaders()
|
||||||
glDeleteShader(vertexShader);
|
glDeleteShader(vertexShader);
|
||||||
glDeleteShader(fragmentShader);
|
glDeleteShader(fragmentShader);
|
||||||
|
|
||||||
TraceLog(INFO, "[ID %i] Default shader program loaded succesfully", program);
|
TraceLog(INFO, "[ID %i] Default shader program loaded successfully", program);
|
||||||
|
|
||||||
return program;
|
return program;
|
||||||
}
|
}
|
||||||
|
@ -1355,8 +1355,8 @@ static GLuint LoadShaders(char *vertexFileName, char *fragmentFileName)
|
||||||
glCompileShader(vertexShader);
|
glCompileShader(vertexShader);
|
||||||
glCompileShader(fragmentShader);
|
glCompileShader(fragmentShader);
|
||||||
|
|
||||||
TraceLog(INFO, "[ID %i] Vertex shader compiled succesfully", vertexShader);
|
TraceLog(INFO, "[ID %i] Vertex shader compiled successfully", vertexShader);
|
||||||
TraceLog(INFO, "[ID %i] Fragment shader compiled succesfully", fragmentShader);
|
TraceLog(INFO, "[ID %i] Fragment shader compiled successfully", fragmentShader);
|
||||||
|
|
||||||
program = glCreateProgram();
|
program = glCreateProgram();
|
||||||
|
|
||||||
|
@ -1368,7 +1368,7 @@ static GLuint LoadShaders(char *vertexFileName, char *fragmentFileName)
|
||||||
glDeleteShader(vertexShader);
|
glDeleteShader(vertexShader);
|
||||||
glDeleteShader(fragmentShader);
|
glDeleteShader(fragmentShader);
|
||||||
|
|
||||||
TraceLog(INFO, "[ID %i] Shader program loaded succesfully", program);
|
TraceLog(INFO, "[ID %i] Shader program loaded successfully", program);
|
||||||
|
|
||||||
return program;
|
return program;
|
||||||
}
|
}
|
||||||
|
@ -1479,7 +1479,7 @@ static void InitializeVAOs()
|
||||||
glEnableVertexAttribArray(colorLoc);
|
glEnableVertexAttribArray(colorLoc);
|
||||||
glVertexAttribPointer(colorLoc, 4, GL_FLOAT, 0, 0, 0);
|
glVertexAttribPointer(colorLoc, 4, GL_FLOAT, 0, 0, 0);
|
||||||
|
|
||||||
TraceLog(INFO, "[ID %i] Lines VAO successfully initialized", vaoLines);
|
TraceLog(INFO, "[ID %i] Lines VAO initialized successfully", vaoLines);
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
|
|
||||||
// Initialize Triangles VAO
|
// Initialize Triangles VAO
|
||||||
|
@ -1500,7 +1500,7 @@ static void InitializeVAOs()
|
||||||
glEnableVertexAttribArray(colorLoc);
|
glEnableVertexAttribArray(colorLoc);
|
||||||
glVertexAttribPointer(colorLoc, 4, GL_FLOAT, 0, 0, 0);
|
glVertexAttribPointer(colorLoc, 4, GL_FLOAT, 0, 0, 0);
|
||||||
|
|
||||||
TraceLog(INFO, "[ID %i] Triangles VAO successfully initialized", vaoTriangles);
|
TraceLog(INFO, "[ID %i] Triangles VAO initialized successfully", vaoTriangles);
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
|
|
||||||
// Initialize Quads VAO (Buffer A)
|
// Initialize Quads VAO (Buffer A)
|
||||||
|
@ -1530,7 +1530,7 @@ static void InitializeVAOs()
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quadsBuffer[3]);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quadsBuffer[3]);
|
||||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(int)*6*MAX_QUADS_BATCH, quads.indices, GL_STATIC_DRAW);
|
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(int)*6*MAX_QUADS_BATCH, quads.indices, GL_STATIC_DRAW);
|
||||||
|
|
||||||
TraceLog(INFO, "[ID %i] Quads VAO successfully initialized", vaoQuads);
|
TraceLog(INFO, "[ID %i] Quads VAO initialized successfully", vaoQuads);
|
||||||
|
|
||||||
#ifdef USE_VBO_DOUBLE_BUFFERS
|
#ifdef USE_VBO_DOUBLE_BUFFERS
|
||||||
// Initialize Quads VAO (Buffer B)
|
// Initialize Quads VAO (Buffer B)
|
||||||
|
|
|
@ -39,8 +39,8 @@
|
||||||
#include "raymath.h" // Required for data type Matrix and Matrix functions
|
#include "raymath.h" // Required for data type Matrix and Matrix functions
|
||||||
|
|
||||||
// Select desired OpenGL version
|
// Select desired OpenGL version
|
||||||
#define USE_OPENGL_11
|
//#define USE_OPENGL_11
|
||||||
//#define USE_OPENGL_33
|
#define USE_OPENGL_33
|
||||||
//#define USE_OPENGL_ES2
|
//#define USE_OPENGL_ES2
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
|
@ -302,7 +302,7 @@ Texture2D LoadTexture(const char *fileName)
|
||||||
texture.height = image.height;
|
texture.height = image.height;
|
||||||
|
|
||||||
if (texture.id == 0) TraceLog(WARNING, "[%s] DDS texture could not be loaded", fileName);
|
if (texture.id == 0) TraceLog(WARNING, "[%s] DDS texture could not be loaded", fileName);
|
||||||
else TraceLog(INFO, "[%s] DDS texture loaded succesfully", fileName);
|
else TraceLog(INFO, "[%s] DDS texture loaded successfully", fileName);
|
||||||
|
|
||||||
free(image.data);
|
free(image.data);
|
||||||
}
|
}
|
||||||
|
@ -444,7 +444,7 @@ Texture2D CreateTexture(Image image, bool genMipmaps)
|
||||||
texture.width = image.width;
|
texture.width = image.width;
|
||||||
texture.height = image.height;
|
texture.height = image.height;
|
||||||
|
|
||||||
TraceLog(INFO, "[ID %i] Texture created succesfully", texture.id);
|
TraceLog(INFO, "[ID %i] Texture created successfully", texture.id);
|
||||||
|
|
||||||
free(imgData);
|
free(imgData);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue