summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/dungeon_crawler/main.lua5
-rw-r--r--examples/heightmap/main.lua10
-rw-r--r--examples/instancing/main.lua3
-rw-r--r--examples/iqm_test/main.lua3
-rw-r--r--examples/point_triangle_collision/main.lua4
-rw-r--r--examples/ray/main.lua3
6 files changed, 11 insertions, 17 deletions
diff --git a/examples/dungeon_crawler/main.lua b/examples/dungeon_crawler/main.lua
index 8732b0d..c572348 100644
--- a/examples/dungeon_crawler/main.lua
+++ b/examples/dungeon_crawler/main.lua
@@ -81,7 +81,6 @@ function RL.init()
RL.SetCamera3DPosition( camera, pos )
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
- RL.SetCameraMode( camera, RL.CAMERA_FIRST_PERSON )
-- for x = 0, 3 do
-- for y = 0, 9 do
@@ -94,9 +93,9 @@ function RL.init()
end
function RL.draw()
- RL.UpdateCamera3D( camera )
+ RL.UpdateCamera3D( camera, RL.CAMERA_FIRST_PERSON )
pos = RL.GetCamera3DPosition( camera )
-
+
-- RL.BeginTextureMode( framebuffer )
RL.ClearBackground( { 100, 150, 150 } )
diff --git a/examples/heightmap/main.lua b/examples/heightmap/main.lua
index 4c66dd6..d046d2a 100644
--- a/examples/heightmap/main.lua
+++ b/examples/heightmap/main.lua
@@ -31,7 +31,7 @@ function RL.init()
RL.SetCamera3DPosition( camera, { 0, 8, 16 } )
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
- RL.SetCameraMode( camera, RL.CAMERA_FREE )
+ -- RL.SetCameraMode( camera, RL.CAMERA_FREE )
heigthImage = RL.LoadImage( RL.GetBasePath().."../resources/images/heightmap.png" )
@@ -58,7 +58,7 @@ function RL.init()
RL.DrawTextureRec( tilesetTex, dirtBottomRec, { pos[1] * TILE_SIZE, pos[2] * TILE_SIZE }, RL.WHITE )
else
RL.DrawTextureRec( tilesetTex, grassRec, { pos[1] * TILE_SIZE, pos[2] * TILE_SIZE }, RL.WHITE )
- end
+ end
end
end
@@ -67,7 +67,7 @@ function RL.init()
material = RL.LoadMaterialDefault()
RL.SetTextureSource( RL.TEXTURE_SOURCE_RENDER_TEXTURE )
-- RL.GenTextureMipmaps( groundTexture )
- -- RL.SetTextureFilter( groundTexture, TEXTURE_FILTER_TRILINEAR )
+ -- RL.SetTextureFilter( groundTexture, RL.TEXTURE_FILTER_TRILINEAR )
RL.SetMaterialTexture( material, RL.MATERIAL_MAP_ALBEDO, groundTexture )
RL.SetTextureSource( RL.TEXTURE_SOURCE_TEXTURE )
@@ -76,8 +76,8 @@ end
function RL.draw()
RL.ClearBackground( { 100, 150, 100 } )
- RL.UpdateCamera3D( camera )
-
+ RL.UpdateCamera3D( camera, RL.CAMERA_FIRST_PERSON )
+
RL.BeginMode3D( camera )
RL.DrawMesh( mesh, material, matrix )
RL.EndMode3D()
diff --git a/examples/instancing/main.lua b/examples/instancing/main.lua
index b7e4024..2711fab 100644
--- a/examples/instancing/main.lua
+++ b/examples/instancing/main.lua
@@ -36,7 +36,6 @@ function RL.init()
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
RL.SetCamera3DFovy( camera, 45 )
- RL.SetCameraMode( camera, RL.CAMERA_ORBITAL )
-- Define mesh to be instanced
cube = RL.GenMeshCube( { 1, 1, 1 } )
@@ -84,7 +83,7 @@ function RL.init()
end
function RL.process( delta )
- RL.UpdateCamera3D( camera )
+ RL.UpdateCamera3D( camera, RL.CAMERA_ORBITAL )
-- Update the light shader with the camera view position
local loc = RL.GetShaderLocationIndex( shader, RL.SHADER_LOC_VECTOR_VIEW )
diff --git a/examples/iqm_test/main.lua b/examples/iqm_test/main.lua
index 486b110..a1040ba 100644
--- a/examples/iqm_test/main.lua
+++ b/examples/iqm_test/main.lua
@@ -23,7 +23,6 @@ function RL.init()
RL.SetCamera3DPosition( camera, { 0, 2, 4 } )
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
- RL.SetCameraMode( camera, RL.CAMERA_FREE )
material = RL.CreateMaterial( {
maps = {
@@ -74,7 +73,7 @@ end
function RL.draw()
RL.ClearBackground( { 100, 150, 100 } )
- RL.UpdateCamera3D( camera )
+ RL.UpdateCamera3D( camera, RL.CAMERA_FIRST_PERSON )
RL.BeginMode3D( camera )
RL.DrawGrid( 8, 1 )
diff --git a/examples/point_triangle_collision/main.lua b/examples/point_triangle_collision/main.lua
index a855dd8..ec837d0 100644
--- a/examples/point_triangle_collision/main.lua
+++ b/examples/point_triangle_collision/main.lua
@@ -19,7 +19,7 @@ local point = {
pos = Vec3:new( 0.2, 0.3, 0.2 ),
radius = 0.05,
lineLen = 0.5,
- color = RED,
+ color = RL.RED,
}
local debugText = ""
@@ -41,7 +41,6 @@ function RL.init()
RL.SetCamera3DPosition( camera, { 0, 1, 2 } )
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
- RL.SetCameraMode( camera, RL.CAMERA_FREE )
calcNormal( tri )
end
@@ -103,7 +102,6 @@ end
function RL.draw()
RL.ClearBackground( { 100, 150, 100 } )
- RL.UpdateCamera3D( camera )
RL.BeginMode3D( camera )
RL.DrawGrid( 8, 1 )
diff --git a/examples/ray/main.lua b/examples/ray/main.lua
index 18b7394..79ba7ee 100644
--- a/examples/ray/main.lua
+++ b/examples/ray/main.lua
@@ -31,7 +31,6 @@ function RL.init()
RL.SetCamera3DPosition( camera, { 0, 2, 4 } )
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
- RL.SetCameraMode( camera, RL.CAMERA_FREE )
sphereMesh = RL.GenMeshSphere( 1.0, 8, 10 )
@@ -47,7 +46,7 @@ end
function RL.draw()
RL.ClearBackground( { 100, 150, 100 } )
- RL.UpdateCamera3D( camera )
+ RL.UpdateCamera3D( camera, RL.CAMERA_FIRST_PERSON )
RL.BeginMode3D( camera )
RL.DrawGrid( 8, 1 )