Skip to content

Commit

Permalink
Merge pull request #19 from foldfelis/main
Browse files Browse the repository at this point in the history
Refine include and add 2d/3d camera test
  • Loading branch information
chengchingwen authored Nov 22, 2021
2 parents d86deea + 79dc759 commit 0474d14
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
21 changes: 10 additions & 11 deletions src/Raylib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ module Raylib
using Raylib_jll
using CEnum

include("./enum.jl")
include("./color.jl")
include("./struct.jl")
include("./binding_gen.jl")
include("./core.jl")
include("./shapes.jl")
include("./textures.jl")
include("./text.jl")
include("./models.jl")
include("./audio.jl")

include("enum.jl")
include("color.jl")
include("struct.jl")
include("binding_gen.jl")
include("core.jl")
include("shapes.jl")
include("textures.jl")
include("text.jl")
include("models.jl")
include("audio.jl")

end
14 changes: 13 additions & 1 deletion test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function test_camera(camera::Raylib.RayCamera3D, ans::Vector)
])
end

@testset "set camera properties" begin
@testset "set camera properties 2d" begin
camera = Raylib.RayCamera2D(
Raylib.rayvector(1, 2), # camera offset
Raylib.rayvector(3, 4), # camera target
Expand All @@ -41,7 +41,9 @@ end
45,
3
])
end

@testset "set camera properties 3d" begin
camera = Raylib.RayCamera3D(
Raylib.rayvector(0, 10, 10), # camera position
Raylib.rayvector(0, 0, 0), # camera looking at point
Expand Down Expand Up @@ -94,4 +96,14 @@ end
60,
Raylib.CAMERA_ORTHOGRAPHIC
])

Raylib.SetCameraMode(camera, Int(Raylib.CAMERA_FIRST_PERSON))
camera = Raylib.UpdateCamera(camera)
@test !test_camera(camera, [
Raylib.rayvector(1, 2, 3),
Raylib.rayvector(3, 2, 1),
Raylib.rayvector(4, 5, 6),
60,
Raylib.CAMERA_FIRST_PERSON
])
end

0 comments on commit 0474d14

Please # to comment.