diff options
| author | raysan5 <[email protected]> | 2017-07-21 09:34:09 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2017-07-21 09:34:09 +0200 |
| commit | 2679c4ae9b2fefdb0c150a7cd576d5d3297b027b (patch) | |
| tree | 31f026ec3d4a0f3a49ecddaa5d9431b61b56de7f /src/raylib.h | |
| parent | 63fd96354e7ceffcdf292a1aac6d564dc694377c (diff) | |
| download | raylib-2679c4ae9b2fefdb0c150a7cd576d5d3297b027b.tar.gz raylib-2679c4ae9b2fefdb0c150a7cd576d5d3297b027b.zip | |
Review mesh loading and textures generation
Diffstat (limited to 'src/raylib.h')
| -rw-r--r-- | src/raylib.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/raylib.h b/src/raylib.h index 22ef06cb..cc5b0bb6 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -409,10 +409,11 @@ typedef struct BoundingBox { } BoundingBox; // Vertex data definning a mesh +// NOTE: Data stored in CPU memory (and GPU) typedef struct Mesh { int vertexCount; // Number of vertices stored in arrays int triangleCount; // Number of triangles stored (indexed or not) - + float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) float *texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) @@ -981,15 +982,19 @@ RLAPI void DrawGizmo(Vector3 position); // Model loading/unloading functions RLAPI Model LoadModel(const char *fileName); // Load model from files (mesh and material) -RLAPI Model LoadModelFromMesh(Mesh mesh, bool dynamic); // Load model from generated mesh +RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh RLAPI void UnloadModel(Model model); // Unload model from memory (RAM and/or VRAM) // Mesh loading/unloading functions RLAPI Mesh LoadMesh(const char *fileName); // Load mesh from file -//RLAPI void UpdateMesh(Mesh *mesh, int type, void *data); // Update mesh data (CPU and GPU) RLAPI void UnloadMesh(Mesh *mesh); // Unload mesh from memory (RAM and/or VRAM) +//RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with desired subdivisions) RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh +//RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) +//RLAPI Mesh GenMeshCylinder(float radiusTop, float radiusBottom, float height, int slices); // Generate cylinder mesh +//RLAPI Mesh GenMeshTorus(float radius1, float radius2, int radSeg, int sides); // Generate torus mesh +//RLAPI Mesh GenMeshTube(float radius1, float radius2, float height, int sides); // Generate tube mesh RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data @@ -997,8 +1002,6 @@ RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); RLAPI Material LoadMaterial(const char *fileName); // Load material from file RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) -RLAPI void SetMaterialTexture(Material *mat, int mapType, Texture2D texture); // Set material texture -RLAPI void UnsetMaterialTexture(Material *mat, int mapType); // Unset texture from material and unload it from GPU // Model drawing functions RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) |
