aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-03-27 18:32:36 +0200
committerraysan5 <raysan5@gmail.com>2016-03-27 18:34:05 +0200
commit8b7ca8b670a0f338fef85125311522833b945bf7 (patch)
tree6a0387726f64b0b55ff7a7033a3c01566f8ab6c4 /src
parent35ee4e52c844552a9d640bfdc4f0a55c14cdc756 (diff)
downloadraylib-8b7ca8b670a0f338fef85125311522833b945bf7.tar.gz
raylib-8b7ca8b670a0f338fef85125311522833b945bf7.zip
Review comments
Diffstat (limited to 'src')
-rw-r--r--src/raylib.h20
-rw-r--r--src/textures.c19
2 files changed, 20 insertions, 19 deletions
diff --git a/src/raylib.h b/src/raylib.h
index 1782fef3..2b65df9e 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -1,6 +1,6 @@
/**********************************************************************************************
*
-* raylib 1.4.0 (www.raylib.com)
+* raylib 1.5.0 (www.raylib.com)
*
* A simple and easy-to-use library to learn videogames programming
*
@@ -345,8 +345,8 @@ typedef struct Camera {
// Camera2D type, defines a 2d camera
typedef struct Camera2D {
- Vector2 position; // Camera position
- Vector2 origin; // Camera origin (for rotation and zoom)
+ Vector2 offset; // Camera offset (displacement from target)
+ Vector2 target; // Camera target (for rotation and zoom)
float rotation; // Camera rotation in degrees
float zoom; // Camera zoom (scaling), should be 1.0f by default
} Camera2D;
@@ -375,7 +375,7 @@ typedef struct Mesh {
// Shader type (generic shader)
typedef struct Shader {
- unsigned int id; // Shader program id
+ unsigned int id; // Shader program id
// Variable attributes
int vertexLoc; // Vertex attribute location point (vertex shader)
@@ -411,9 +411,9 @@ typedef struct Material {
// 3d Model type
// TODO: Replace shader/testure by material
typedef struct Model {
- Mesh mesh;
- Matrix transform;
- Material material;
+ Mesh mesh; // Vertex data buffers (RAM and VRAM)
+ Matrix transform; // Local transform matrix
+ Material material; // Shader and textures data
} Model;
// Ray type (useful for raycast)
@@ -432,8 +432,8 @@ typedef struct Sound {
typedef struct Wave {
void *data; // Buffer data pointer
unsigned int dataSize; // Data size in bytes
- unsigned int sampleRate;
- short bitsPerSample;
+ unsigned int sampleRate; // Samples per second to be played
+ short bitsPerSample; // Sample size in bits
short channels;
} Wave;
@@ -484,7 +484,7 @@ typedef enum { TOUCH_UP, TOUCH_DOWN, TOUCH_MOVE } TouchAction;
// Gesture events
// NOTE: MAX_TOUCH_POINTS fixed to 2
-typedef struct {
+typedef struct GestureEvent {
int touchAction;
int pointCount;
int pointerId[MAX_TOUCH_POINTS];
diff --git a/src/textures.c b/src/textures.c
index e649df57..9d0d13b6 100644
--- a/src/textures.c
+++ b/src/textures.c
@@ -29,21 +29,21 @@
#include "raylib.h"
-#include <stdlib.h> // Declares malloc() and free() for memory management
-#include <string.h> // Required for strcmp(), strrchr(), strncmp()
+#include <stdlib.h> // Declares malloc() and free() for memory management
+#include <string.h> // Required for strcmp(), strrchr(), strncmp()
-#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3 or ES2
- // Required: rlglLoadTexture() rlDeleteTextures(),
- // rlglGenerateMipmaps(), some funcs for DrawTexturePro()
+#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3 or ES2
+ // Required: rlglLoadTexture() rlDeleteTextures(),
+ // rlglGenerateMipmaps(), some funcs for DrawTexturePro()
-#include "utils.h" // rRES data decompression utility function
- // NOTE: Includes Android fopen function map
+#include "utils.h" // rRES data decompression utility function
+ // NOTE: Includes Android fopen function map
#define STB_IMAGE_IMPLEMENTATION
-#include "stb_image.h" // Used to read image data (multiple formats support)
+#include "stb_image.h" // Used to read image data (multiple formats support)
#define STB_IMAGE_RESIZE_IMPLEMENTATION
-#include "stb_image_resize.h"
+#include "stb_image_resize.h" // Used on image scaling function: ImageResize()
//----------------------------------------------------------------------------------
// Defines and Macros
@@ -130,6 +130,7 @@ Image LoadImage(const char *fileName)
}
// Load image data from Color array data (RGBA - 32bit)
+// NOTE: Creates a copy of pixels data array
Image LoadImageEx(Color *pixels, int width, int height)
{
Image image;