Removed function SetModelTexture()
It's more educational to go through new material system, so, I decide to remove this function to avoid students confusion...
This commit is contained in:
parent
b358402cb3
commit
5f7ac64c44
9 changed files with 11 additions and 18 deletions
|
@ -1,20 +1,20 @@
|
||||||
changelog
|
changelog
|
||||||
---------
|
---------
|
||||||
|
|
||||||
Current Release: raylib 1.5.0 (23 June 2016)
|
Current Release: raylib 1.5.0 (xx June 2016)
|
||||||
|
|
||||||
NOTE: Only versions marked as 'Release' are available in installer, updates are only available as source.
|
NOTE: Only versions marked as 'Release' are available in installer, updates are only available as source.
|
||||||
NOTE: Current Release includes all previous updates.
|
NOTE: Current Release includes all previous updates.
|
||||||
|
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
Release: raylib 1.5.0 (23 June 2016)
|
Release: raylib 1.5.0 (xx June 2016)
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
NOTE:
|
NOTE:
|
||||||
Probably this new version is the biggest boost of the library ever, lots of parts of the library have been redesigned,
|
Probably this new version is the biggest boost of the library ever, lots of parts of the library have been redesigned,
|
||||||
lots of bugs have been solved and some **AMAZING** new features have been added.
|
lots of bugs have been solved and some **AMAZING** new features have been added.
|
||||||
|
|
||||||
HUGE changes:
|
HUGE changes:
|
||||||
[core] OCULUS RIFT CV1: Added support for VR witha bunch of Oculus-specific functions to init/close device and Oculus rendering.
|
[rlgl] OCULUS RIFT CV1: Added support for VR witha bunch of Oculus-specific functions to init/close device and Oculus rendering.
|
||||||
[rlgl] MATERIALS SYSTEM: Added support for Materials (.mtl) and multiple material properties: diffuse, specular, normal.
|
[rlgl] MATERIALS SYSTEM: Added support for Materials (.mtl) and multiple material properties: diffuse, specular, normal.
|
||||||
[rlgl] LIGHTING SYSTEM: Added support for up to 8 lights of 3 different types: Omni, Directional and Spot
|
[rlgl] LIGHTING SYSTEM: Added support for up to 8 lights of 3 different types: Omni, Directional and Spot
|
||||||
[physac] REDESIGNED: Improved performance and simplified usage, physic objects are managed internally
|
[physac] REDESIGNED: Improved performance and simplified usage, physic objects are managed internally
|
||||||
|
@ -65,6 +65,7 @@ other changes:
|
||||||
[models] Updated BoundingBox collision detections
|
[models] Updated BoundingBox collision detections
|
||||||
[models] Added color parameter to DrawBoundigBox()
|
[models] Added color parameter to DrawBoundigBox()
|
||||||
[models] Removed function: DrawQuad()
|
[models] Removed function: DrawQuad()
|
||||||
|
[models] Removed function: SetModelTexture()
|
||||||
[models] Redesigned DrawPlane() to use RL_TRIANGLES
|
[models] Redesigned DrawPlane() to use RL_TRIANGLES
|
||||||
[models] Redesigned DrawRectangleV() to use RL_TRIANGLES
|
[models] Redesigned DrawRectangleV() to use RL_TRIANGLES
|
||||||
[models] Redesign to accomodate new materials system: LoadMaterial()
|
[models] Redesign to accomodate new materials system: LoadMaterial()
|
||||||
|
|
|
@ -29,7 +29,7 @@ int main()
|
||||||
|
|
||||||
// NOTE: By default each cube is mapped to one part of texture atlas
|
// NOTE: By default each cube is mapped to one part of texture atlas
|
||||||
Texture2D texture = LoadTexture("resources/cubicmap_atlas.png"); // Load map texture
|
Texture2D texture = LoadTexture("resources/cubicmap_atlas.png"); // Load map texture
|
||||||
SetModelTexture(&map, texture); // Bind texture to map model
|
map.material.texDiffuse = texture; // Set map diffuse texture
|
||||||
|
|
||||||
Vector3 mapPosition = { -16.0f, 0.0f, -8.0f }; // Set model position
|
Vector3 mapPosition = { -16.0f, 0.0f, -8.0f }; // Set model position
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ int main()
|
||||||
Image image = LoadImage("resources/heightmap.png"); // Load heightmap image (RAM)
|
Image image = LoadImage("resources/heightmap.png"); // Load heightmap image (RAM)
|
||||||
Texture2D texture = LoadTextureFromImage(image); // Convert image to texture (VRAM)
|
Texture2D texture = LoadTextureFromImage(image); // Convert image to texture (VRAM)
|
||||||
Model map = LoadHeightmap(image, (Vector3){ 16, 8, 16 }); // Load heightmap model with defined size
|
Model map = LoadHeightmap(image, (Vector3){ 16, 8, 16 }); // Load heightmap model with defined size
|
||||||
SetModelTexture(&map, texture); // Bind texture to model
|
map.material.texDiffuse = texture; // Set map diffuse texture
|
||||||
Vector3 mapPosition = { -8.0f, 0.0f, -8.0f }; // Set model position (depends on model scaling!)
|
Vector3 mapPosition = { -8.0f, 0.0f, -8.0f }; // Set model position (depends on model scaling!)
|
||||||
|
|
||||||
UnloadImage(image); // Unload heightmap image from RAM, already uploaded to VRAM
|
UnloadImage(image); // Unload heightmap image from RAM, already uploaded to VRAM
|
||||||
|
|
|
@ -25,7 +25,7 @@ int main()
|
||||||
|
|
||||||
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model
|
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model
|
||||||
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture
|
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture
|
||||||
SetModelTexture(&dwarf, texture); // Bind texture to model
|
dwarf.material.texDiffuse = texture; // Set dwarf model diffuse texture
|
||||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
|
|
|
@ -34,7 +34,7 @@ int main()
|
||||||
|
|
||||||
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model
|
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model
|
||||||
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture (diffuse map)
|
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture (diffuse map)
|
||||||
SetModelTexture(&dwarf, texture); // Bind texture to model
|
dwarf.material.texDiffuse = texture; // Set dwarf model diffuse texture
|
||||||
|
|
||||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ int main()
|
||||||
|
|
||||||
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model
|
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model
|
||||||
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture (diffuse map)
|
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture (diffuse map)
|
||||||
SetModelTexture(&dwarf, texture); // Bind texture to model
|
dwarf.material.texDiffuse = texture; // Set dwarf model diffuse texture
|
||||||
|
|
||||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ int main()
|
||||||
|
|
||||||
catTexture = LoadTexture("resources/catsham.png"); // Load model texture
|
catTexture = LoadTexture("resources/catsham.png"); // Load model texture
|
||||||
cat = LoadModel("resources/cat.obj"); // Load OBJ model
|
cat = LoadModel("resources/cat.obj"); // Load OBJ model
|
||||||
SetModelTexture(&cat, catTexture);
|
cat.material.texDiffuse = texture; // Set cat model diffuse texture
|
||||||
|
|
||||||
fxWav = LoadSound("resources/audio/weird.wav"); // Load WAV audio file
|
fxWav = LoadSound("resources/audio/weird.wav"); // Load WAV audio file
|
||||||
fxOgg = LoadSound("resources/audio/tanatana.ogg"); // Load OGG audio file
|
fxOgg = LoadSound("resources/audio/tanatana.ogg"); // Load OGG audio file
|
||||||
|
|
|
@ -808,13 +808,6 @@ void UnloadMaterial(Material material)
|
||||||
rlDeleteTextures(material.texSpecular.id);
|
rlDeleteTextures(material.texSpecular.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Link a texture to a model
|
|
||||||
void SetModelTexture(Model *model, Texture2D texture)
|
|
||||||
{
|
|
||||||
if (texture.id <= 0) model->material.texDiffuse = GetDefaultTexture(); // Use default white texture
|
|
||||||
else model->material.texDiffuse = texture;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate a mesh from heightmap
|
// Generate a mesh from heightmap
|
||||||
static Mesh GenMeshHeightmap(Image heightmap, Vector3 size)
|
static Mesh GenMeshHeightmap(Image heightmap, Vector3 size)
|
||||||
{
|
{
|
||||||
|
|
|
@ -795,7 +795,6 @@ Model LoadModelFromRES(const char *rresName, int resId); // Load a 3d mod
|
||||||
Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model
|
Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model
|
||||||
Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based)
|
Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based)
|
||||||
void UnloadModel(Model model); // Unload 3d model from memory
|
void UnloadModel(Model model); // Unload 3d model from memory
|
||||||
void SetModelTexture(Model *model, Texture2D texture); // Link a texture to a model
|
|
||||||
|
|
||||||
Material LoadMaterial(const char *fileName); // Load material data (from file)
|
Material LoadMaterial(const char *fileName); // Load material data (from file)
|
||||||
Material LoadDefaultMaterial(void); // Load default material (uses default models shader)
|
Material LoadDefaultMaterial(void); // Load default material (uses default models shader)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue