Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
Update Raylib to 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
greenfork committed Aug 28, 2022
1 parent 9a7ff44 commit 59154ab
Show file tree
Hide file tree
Showing 69 changed files with 68,862 additions and 52,468 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "raylib"]
path = raylib
url = https://github.com/raysan5/raylib.git
[submodule "physac"]
path = physac
url = https://github.com/raysan5/physac.git
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ side it should mainly consist of renaming, please try the wonderful tool

Additionally you can consult [Raylib's changelog](https://github.com/raysan5/raylib/blob/master/CHANGELOG).

## NimraylibNow! v0.15, Raylib v4.2 and Raygui v3.2

NimraylibNow!-specific changes:
- Emscripten support is improved: added TOTAL_MEMORY option and it now allows
using resources from your file system. See [Emscripten example readme](/examples/emscripten/README.md),
"Compile options" section.

Raylib-specific changes - consult [Raylib's changelog](https://github.com/raysan5/raylib/blob/master/CHANGELOG) file.

## NimraylibNow! v0.14 and Raylib v4.0

NimraylibNow!-specific changes:
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ Explanation of flags:

## Current version and upgrading from previous versions

NimraylibNow! v0.14 is a wrapper for [Raylib v4.0.0] and [Raygui v3.0].
NimraylibNow! v0.15 is a wrapper for [Raylib v4.2.0] and [Raygui v3.2] and works
for Nim v1.4.2+.

See [CHANGELOG](CHANGELOG.md) for any tips on how to upgrade your code
from previous versions.

[Raylib v4.0.0]: https://github.com/raysan5/raylib/releases/tag/4.0.0
[Raygui v3.0]: https://github.com/raysan5/raygui/releases/tag/3.0
[Raylib v4.2.0]: https://github.com/raysan5/raylib/releases/tag/4.2.0
[Raygui v3.2]: https://github.com/raysan5/raygui/releases/tag/3.2

## Install NimraylibNow!

Expand Down
18 changes: 9 additions & 9 deletions examples/models/models_loading.nim
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@ while not windowShouldClose():
# Load new models/textures on drag&drop
if isFileDropped():
var count: cint = 0
var droppedFiles = getDroppedFiles(count.addr)
var droppedFiles = loadDroppedFiles()

if count == 1: # only support one file dropped
if droppedFiles.count == 1: # only support one file dropped
# Model file formats supported
if isFileExtension(fileName=droppedFiles[0], ext=".obj") or
isFileExtension(fileName=droppedFiles[0], ext=".gltf") or
isFileExtension(fileName=droppedFiles[0], ext=".iqm"):
if isFileExtension(fileName=droppedFiles.paths[0], ext=".obj") or
isFileExtension(fileName=droppedFiles.paths[0], ext=".gltf") or
isFileExtension(fileName=droppedFiles.paths[0], ext=".iqm"):
unloadModel(model) # unload previous model
model = loadModel(droppedFiles[0]) # load new model
model = loadModel(droppedFiles.paths[0]) # load new model
model.materials[0].maps[MaterialMapIndex.Albedo.int].texture = texture # Set current map diffuse texture
bounds = getMeshBoundingBox(model.meshes[0]) # set new model bounds
# TODO: Move camera position from target enough distance to visualize model properly
elif isFileExtension(droppedFiles[0],".png"): # Texture fil formats supported
elif isFileExtension(droppedFiles.paths[0],".png"): # Texture fil formats supported
# unload current model texture and load new one
unloadTexture(texture)
texture = loadTexture(droppedFiles[0])
texture = loadTexture(droppedFiles.paths[0])
model.materials[0].maps[MaterialMapIndex.Albedo.int].texture = texture

clearDroppedFiles() # Clear internal buffers
unloadDroppedFiles(droppedFiles) # Clear internal buffers

# Select model on mouse click
if isMouseButtonPressed(MouseButton.Left):
Expand Down
2 changes: 1 addition & 1 deletion nimraylib_now.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.14.2"
version = "0.15.0"
author = "Dmitry Matveyev"
description = "The Ultimate Raylib gaming library wrapper"
license = "MIT"
Expand Down
1 change: 1 addition & 0 deletions physac
Submodule physac added at 4a8e17
1 change: 1 addition & 0 deletions raygui
Submodule raygui added at 10ebad
2 changes: 1 addition & 1 deletion raylib
Submodule raylib updated 401 files
13 changes: 6 additions & 7 deletions src/csources/raylib_mangled/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Setup the project and settings
project(raylib C)
set(PROJECT_VERSION 4.0.0)
set(API_VERSION 400)
set(PROJECT_VERSION 4.2.0)
set(API_VERSION 420)

include(GNUInstallDirs)
include(JoinPaths)
Expand All @@ -25,7 +25,6 @@ set(raylib_public_headers
raylib.h
rlgl.h
raymath.h
raudio.h
)

# Sources to be compiled
Expand All @@ -41,6 +40,10 @@ set(raylib_sources
# <root>/cmake/GlfwImport.cmake handles the details around the inclusion of glfw
include(GlfwImport)

# Sets additional platform options and link libraries for each platform
# also selects the proper graphics API and version for that platform
# Produces a variable LIBS_PRIVATE that will be used later
include(LibraryConfigurations)

if (USE_AUDIO)
MESSAGE(STATUS "Audio Backend: miniaudio")
Expand All @@ -49,10 +52,6 @@ else ()
MESSAGE(STATUS "Audio Backend: None (-DUSE_AUDIO=OFF)")
endif ()

# Sets additional platform options and link libraries for each platform
# also selects the proper graphics API and version for that platform
# Produces a variable LIBS_PRIVATE that will be used later
include(LibraryConfigurations)

add_library(raylib ${raylib_sources} ${raylib_public_headers})

Expand Down
Loading

0 comments on commit 59154ab

Please sign in to comment.