update raylib to 4.5
This commit is contained in:
parent
cbcb0719a6
commit
42d6762fbe
60 changed files with 6581 additions and 18340 deletions
|
@ -31,13 +31,11 @@ for i in range(MAX_COLUMNS):
|
|||
colors[i] = pyray.Color(pyray.get_random_value(20, 255), pyray.get_random_value(10, 55), 30, 255)
|
||||
|
||||
|
||||
pyray.set_camera_mode(camera, pyray.CAMERA_FIRST_PERSON) # Set a first person camera mode
|
||||
|
||||
pyray.set_target_fps(60)
|
||||
|
||||
while not pyray.window_should_close():
|
||||
|
||||
pyray.update_camera(camera)
|
||||
pyray.update_camera(camera, pyray.CAMERA_FIRST_PERSON)
|
||||
|
||||
pyray.begin_drawing()
|
||||
|
||||
|
|
|
@ -26,8 +26,6 @@ count = ray.ffi.new("unsigned int *", 1)
|
|||
anims = ray.load_model_animations("resources/models/iqm/guyanim.iqm", count)
|
||||
anim_frame_counter = 0
|
||||
|
||||
ray.set_camera_mode(camera, ray.CAMERA_FREE) # Set free camera mode
|
||||
|
||||
ray.set_target_fps(60) # Set our game to run at 60 frames-per-second
|
||||
#--------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -35,7 +33,7 @@ ray.set_target_fps(60) # Set our game to run at 60 frames-per-
|
|||
while not ray.window_should_close(): # Detect window close button or ESC key
|
||||
# Update
|
||||
#----------------------------------------------------------------------------------
|
||||
ray.update_camera(camera)
|
||||
ray.update_camera(camera, ray.CAMERA_FREE)
|
||||
|
||||
# Play animation when spacebar is held down
|
||||
if ray.is_key_down(ray.KEY_SPACE):
|
||||
|
|
|
@ -33,8 +33,6 @@ camera.projection = CAMERA_PERSPECTIVE
|
|||
bill = LoadTexture(b"resources/billboard.png") # Our texture billboard
|
||||
billPosition = [ 0.0, 2.0, 0.0 ] # Position where draw billboard
|
||||
|
||||
SetCameraMode(camera, CAMERA_ORBITAL) # Set an orbital camera mode
|
||||
|
||||
SetTargetFPS(60) # Set our game to run at 60 frames-per-second
|
||||
#--------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -42,7 +40,7 @@ SetTargetFPS(60) # Set our game to run at 60 frames-per-se
|
|||
while not WindowShouldClose() : # Detect window close button or ESC key
|
||||
# Update
|
||||
#----------------------------------------------------------------------------------
|
||||
UpdateCamera(cameraPtr) # Update camera
|
||||
UpdateCamera(cameraPtr, CAMERA_ORBITAL) # Update camera
|
||||
#----------------------------------------------------------------------------------
|
||||
|
||||
# Draw
|
||||
|
|
|
@ -36,7 +36,6 @@ mapPosition = [ -16.0, 0.0, -8.0 ] # Set model position
|
|||
|
||||
UnloadImage(image) # Unload cubesmap image from RAM, already uploaded to VRAM
|
||||
|
||||
SetCameraMode(camera[0], CAMERA_ORBITAL) # Set an orbital camera mode
|
||||
|
||||
SetTargetFPS(60) # Set our game to run at 60 frames-per-second
|
||||
#--------------------------------------------------------------------------------------
|
||||
|
@ -46,7 +45,7 @@ while not WindowShouldClose(): # Detect window close button or ESC key
|
|||
|
||||
# Update
|
||||
#----------------------------------------------------------------------------------
|
||||
UpdateCamera(camera) # Update camera
|
||||
UpdateCamera(camera, CAMERA_ORBITAL) # Update camera
|
||||
#----------------------------------------------------------------------------------
|
||||
|
||||
# Draw
|
||||
|
|
|
@ -32,8 +32,6 @@ mapPosition = ( -8.0, 0.0, -8.0 ) # Define model position
|
|||
|
||||
UnloadImage(image) # Unload heightmap image from RAM, already uploaded to VRAM
|
||||
|
||||
SetCameraMode(camera[0], CAMERA_ORBITAL) # Set an orbital camera mode
|
||||
|
||||
SetTargetFPS(60) # Set our game to run at 60 frames-per-second
|
||||
#--------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -41,7 +39,7 @@ SetTargetFPS(60) # Set our game to run at 60 frames-per-se
|
|||
while not WindowShouldClose(): # Detect window close button or ESC key
|
||||
# Update
|
||||
#----------------------------------------------------------------------------------
|
||||
UpdateCamera(camera) # Update camera
|
||||
UpdateCamera(camera, CAMERA_ORBITAL) # Update camera
|
||||
#----------------------------------------------------------------------------------
|
||||
|
||||
# Draw
|
||||
|
|
|
@ -26,7 +26,6 @@ camera.up = [ 0.0, 1.0, 0.0 ] # Camera up vector (rotation towards targ
|
|||
camera.fovy = 45.0 # Camera field-of-view Y
|
||||
camera.projection = CAMERA_PERSPECTIVE # Camera mode type
|
||||
|
||||
rl.SetCameraMode(camera[0], rl.CAMERA_ORBITAL)
|
||||
|
||||
model = LoadModel(b"resources/models/house.obj") # Load OBJ model
|
||||
texture = LoadTexture(b"resources/models/house_diffuse.png") # Load model texture
|
||||
|
@ -42,7 +41,7 @@ while not WindowShouldClose(): # Detect window close button or ESC key
|
|||
#----------------------------------------------------------------------------------
|
||||
#...
|
||||
#----------------------------------------------------------------------------------
|
||||
rl.UpdateCamera(camera);
|
||||
rl.UpdateCamera(camera, rl.CAMERA_ORBITAL)
|
||||
# Draw
|
||||
#----------------------------------------------------------------------------------
|
||||
BeginDrawing()
|
||||
|
|
|
@ -42,12 +42,10 @@ skybox.materials[0].maps[rl.MAP_CUBEMAP].texture = rl.GenTextureCubemap(shdrCube
|
|||
rl.UnloadTexture(texHDR)
|
||||
rl.UnloadShader(shdrCubemap)
|
||||
|
||||
rl.SetCameraMode(camera[0], rl.CAMERA_FIRST_PERSON)
|
||||
|
||||
rl.SetTargetFPS(60)
|
||||
|
||||
while not rl.WindowShouldClose():
|
||||
rl.UpdateCamera(camera)
|
||||
rl.UpdateCamera(camera, rl.CAMERA_FIRST_PERSON)
|
||||
rl.BeginDrawing()
|
||||
rl.ClearBackground(RAYWHITE)
|
||||
rl.BeginMode3D(camera[0])
|
||||
|
|
|
@ -90,8 +90,6 @@ modelA.materials[0].shader = lightSystem.shader
|
|||
modelB.materials[0].shader = lightSystem.shader
|
||||
modelC.materials[0].shader = lightSystem.shader
|
||||
|
||||
rl.SetCameraMode(camera[0], rl.CAMERA_ORBITAL) # Set an orbital camera mode
|
||||
|
||||
rl.SetTargetFPS(60) # // Set our game to run at 60 frames-per-second
|
||||
# --------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -104,7 +102,7 @@ while not rl.WindowShouldClose(): # Detect window close button or ESC key
|
|||
if rl.IsKeyPressed(rl.KEY_G): lights2.enabled = not lights2.enabled
|
||||
if rl.IsKeyPressed(rl.KEY_B): lights3.enabled = not lights3.enabled
|
||||
|
||||
rl.UpdateCamera(camera) # Update camera
|
||||
rl.UpdateCamera(camera, rl.CAMERA_ORBITAL) # Update camera
|
||||
|
||||
# Make the lights do differing orbits
|
||||
angle -= 0.02
|
||||
|
|
Reference in a new issue