Skip to content

Commit 37f51c4

Browse files
committed
update libmedia
1 parent 19e6178 commit 37f51c4

File tree

16 files changed

+220
-45
lines changed

16 files changed

+220
-45
lines changed

builds_raylib_dev.sh

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ rm -f ../../libs/x86_32-linux/*
122122
rm -f ../../libs/x86_32-linux/include_raymedia/*
123123
rm -f ../../libs/x86_64-win64/*
124124
rm -f ../../libs/i386-win32/*
125-
rm -f ../../libs/x86_64-win64/include_raymedia/*
126-
rm -f ../../libs/i386-win32/include_raymedia/*
125+
#rm -f ../../libs/x86_64-win64/include_raymedia/*
126+
#rm -f ../../libs/i386-win32/include_raymedia/*
127127

128128
make clean
129129
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_MODULE_RAYGUI=TRUE RAYLIB_MODULE_GIZMO=TRUE #RAYLIB_MODULE_RAYMEDIA=TRUE
@@ -163,7 +163,6 @@ make clean
163163
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_MODULE_RAYGUI=TRUE RAYLIB_MODULE_GIZMO=TRUE RAYLIB_MODULE_RAYMEDIA=TRUE LDFLAG=-m32
164164
cp libraylib.so.5.5.0 ../../libs/x86_32-linux/include_raymedia/libraylib.so.550
165165

166-
167166
echo -e "\e[34m \e[1m"
168167
echo "Build x86_32_LINUX Statics"
169168
echo -e "\e[0m"
@@ -189,8 +188,12 @@ cp libraylib.a ../../libs/x86_32-linux/include_raymedia/libraylib.a
189188

190189
#--------------------------------------------------------------------------------------------------------
191190

192-
193-
191+
# Build from windows only
192+
# download compiled ffmpeg
193+
# win64 https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n7.1-latest-win64-lgpl-shared-7.1.zip
194+
# or https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-ffmpeg-7.1-6-any.pkg.tar.zst
195+
# wni32 https://mirror.msys2.org/mingw/mingw32/mingw-w64-i686-ffmpeg-7.1-6-any.pkg.tar.zst
196+
# copy lib include or etc to mingw
194197
echo -e "\e[34m \e[1m"
195198
echo " build x64 windows"
196199
echo -e "\e[0m"
@@ -204,12 +207,12 @@ make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_MODULE_RAYGUI=TRUE R
204207
#cp libraylibdll.a ../../libs/x86_64-win64
205208
cp raylib.dll ../../libs/x86_64-win64/libraylib.dll
206209

207-
make clean
208-
x86_64-w64-mingw32-windres raylib.rc -o raylib.rc.data
209-
x86_64-w64-mingw32-windres raylib.dll.rc -o raylib.dll.rc.data
210-
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_MODULE_RAYGUI=TRUE RAYLIB_MODULE_GIZMO=TRUE RAYLIB_MODULE_RAYMEDIA=TRUE OS=Windows_NT CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar
210+
#make clean
211+
#x86_64-w64-mingw32-windres raylib.rc -o raylib.rc.data
212+
#x86_64-w64-mingw32-windres raylib.dll.rc -o raylib.dll.rc.data
213+
#make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_MODULE_RAYGUI=TRUE RAYLIB_MODULE_GIZMO=TRUE RAYLIB_MODULE_RAYMEDIA=TRUE OS=Windows_NT CC=x86_64-w64-mingw32-gcc #AR=x86_64-w64-mingw32-ar
211214
#cp libraylibdll.a ../../libs/x86_64-win64
212-
cp raylib.dll ../../libs/x86_64-win64/include_raymedia/libraylib.dll
215+
#cp raylib.dll ../../libs/x86_64-win64/include_raymedia/libraylib.dll
213216

214217
#---------------------------------------------------------------------------------------------------------
215218

@@ -228,16 +231,16 @@ make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_MODULE_RAYGUI=TRUE R
228231
cp raylib.dll ../../libs/i386-win32/libraylib.dll
229232

230233

231-
make clean
232-
i686-w64-mingw32-windres raylib.rc -o raylib.rc.data
233-
i686-w64-mingw32-windres raylib.dll.rc -o raylib.dll.rc.data
234+
# make clean
235+
# i686-w64-mingw32-windres raylib.rc -o raylib.rc.data
236+
#i686-w64-mingw32-windres raylib.dll.rc -o raylib.dll.rc.data
234237

235238
#echo "#define RAYGUI_IMPLEMENTATION" > raygui.c && echo "#include <extras/raygui.h>" >> raygui.c
236239
#echo "#define PHYSAC_IMPLEMENTATION" > physac.c && echo "#include <extras/physac.h>" >> physac.c
237240

238-
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_MODULE_RAYGUI=TRUE RAYLIB_MODULE_GIZMO=TRUE RAYLIB_MODULE_RAYMEDIA=TRUE OS=Windows_NT CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar
241+
#make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_MODULE_RAYGUI=TRUE RAYLIB_MODULE_GIZMO=TRUE RAYLIB_MODULE_RAYMEDIA=TRUE OS=Windows_NT CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar
239242
#cp libraylibdll.a ../../libs/i386-win32
240-
cp raylib.dll ../../libs/i386-win32/include_raymedia/libraylib.dll
243+
#cp raylib.dll ../../libs/i386-win32/include_raymedia/libraylib.dll
241244

242245

243246
#---------------------------------------------------------------------------------------------------

examples/extra/rayGizmo/gizmo.lpi

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<CONFIG>
3+
<ProjectOptions>
4+
<Version Value="12"/>
5+
<General>
6+
<Flags>
7+
<MainUnitHasCreateFormStatements Value="False"/>
8+
<MainUnitHasTitleStatement Value="False"/>
9+
<MainUnitHasScaledStatement Value="False"/>
10+
</Flags>
11+
<SessionStorage Value="InProjectDir"/>
12+
<Title Value="gizmo"/>
13+
<UseAppBundle Value="False"/>
14+
<ResourceType Value="res"/>
15+
</General>
16+
<BuildModes>
17+
<Item Name="Default" Default="True"/>
18+
</BuildModes>
19+
<PublishOptions>
20+
<Version Value="2"/>
21+
<UseFileFilters Value="True"/>
22+
</PublishOptions>
23+
<RunParams>
24+
<FormatVersion Value="2"/>
25+
</RunParams>
26+
<RequiredPackages>
27+
<Item>
28+
<PackageName Value="ray4laz"/>
29+
</Item>
30+
</RequiredPackages>
31+
<Units>
32+
<Unit>
33+
<Filename Value="gizmo.lpr"/>
34+
<IsPartOfProject Value="True"/>
35+
</Unit>
36+
</Units>
37+
</ProjectOptions>
38+
<CompilerOptions>
39+
<Version Value="11"/>
40+
<Target>
41+
<Filename Value="../../../binary/gizmo"/>
42+
</Target>
43+
<SearchPaths>
44+
<IncludeFiles Value="$(ProjOutDir)"/>
45+
<UnitOutputDirectory Value="../../../temp/$(TargetCPU)-$(TargetOS)"/>
46+
</SearchPaths>
47+
<Linking>
48+
<Debugging>
49+
<DebugInfoType Value="dsDwarf3"/>
50+
</Debugging>
51+
</Linking>
52+
</CompilerOptions>
53+
<Debugging>
54+
<Exceptions>
55+
<Item>
56+
<Name Value="EAbort"/>
57+
</Item>
58+
<Item>
59+
<Name Value="ECodetoolError"/>
60+
</Item>
61+
<Item>
62+
<Name Value="EFOpenError"/>
63+
</Item>
64+
</Exceptions>
65+
</Debugging>
66+
</CONFIG>

examples/extra/rayGizmo/gizmo.lpr

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
program gizmo;
2+
3+
{$mode objfpc}{$H+}
4+
5+
uses
6+
{$IFNDEF WINDOWS}cthreads,{$ENDIF}
7+
Classes, SysUtils, CustApp, raylib, raymath, raygizmo;
8+
9+
type
10+
{ TRayApplication }
11+
TRayApplication = class(TCustomApplication)
12+
protected
13+
procedure DoRun; override;
14+
public
15+
constructor Create(TheOwner: TComponent); override;
16+
destructor Destroy; override;
17+
end;
18+
19+
const AppTitle = 'raylib - basic window';
20+
CRATE_COUNT = 4;
21+
var crateTransforms: array [0..CRATE_COUNT -1] of TTransform;
22+
crateTexture: TTexture;
23+
crateModel: TModel;
24+
cam: TCamera;
25+
gizmoTypes: array[0..CRATE_COUNT -1] of integer;
26+
{ TRayApplication }
27+
28+
constructor TRayApplication.Create(TheOwner: TComponent);
29+
var i: integer;
30+
begin
31+
inherited Create(TheOwner);
32+
33+
InitWindow(800, 600, AppTitle); // for window settings, look at example - window flags
34+
35+
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
36+
37+
// Initialize the transforms with default values
38+
for i:= 0 to CRATE_COUNT -1 do
39+
begin
40+
crateTransforms[i] := GizmoIdentity();
41+
crateTransforms[i].translation.x := -15.0 + 6.0 * i; // Offset crates along the X-axis
42+
end;
43+
44+
// Assign each crate a different gizmo type
45+
gizmoTypes[0] := GIZMO_TRANSLATE;
46+
gizmoTypes[1] := GIZMO_SCALE;
47+
gizmoTypes[2] := GIZMO_ROTATE;
48+
gizmoTypes[3] := GIZMO_ALL;
49+
50+
// Load the crate texture.
51+
crateTexture := LoadTexture('resources/models/crate_texture.jpg');
52+
GenTextureMipmaps(@crateTexture);
53+
SetTextureFilter(crateTexture, TEXTURE_FILTER_TRILINEAR);
54+
55+
// Load the crate model and apply the texture.
56+
crateModel := LoadModel('resources/models/crate_model.obj');
57+
crateModel.materials[0].maps[MATERIAL_MAP_ALBEDO].texture := crateTexture;
58+
59+
// Setup the 3D camera.
60+
cam.fovy := 45.0;
61+
cam.position := Vector3Create( 7.5, 5.5, 5.0 );
62+
cam.target := Vector3Create( 0, 1.5, 0 );
63+
cam.up := Vector3Create( 0, 1, 0 );
64+
cam.projection := CAMERA_PERSPECTIVE;
65+
66+
67+
end;
68+
69+
procedure TRayApplication.DoRun;
70+
var i: integer;
71+
begin
72+
73+
while (not WindowShouldClose) do // Detect window close button or ESC key
74+
begin
75+
BeginDrawing();
76+
77+
// Clear the background with a dark blue color.
78+
ClearBackground(ColorCreate( 0, 0, 25, 255 ));
79+
80+
BeginMode3D(cam);
81+
82+
// Draw the crates with their updated transforms
83+
for i := 0 to CRATE_COUNT - 1 do
84+
begin
85+
crateModel.transform := GizmoToMatrix(crateTransforms[i]);
86+
DrawModel(crateModel, Vector3Zero(), 1.0, WHITE);
87+
end;
88+
89+
// Draw the gizmos and handle user input
90+
for i := 0 to CRATE_COUNT - 1 do
91+
DrawGizmo3D(gizmoTypes[i], @crateTransforms[i]);
92+
93+
94+
EndMode3D();
95+
EndDrawing();
96+
97+
end;
98+
99+
// Stop program loop
100+
Terminate;
101+
end;
102+
103+
destructor TRayApplication.Destroy;
104+
begin
105+
// Unload resources and clean up.
106+
UnloadTexture(crateTexture);
107+
UnloadModel(crateModel);
108+
// De-Initialization
109+
CloseWindow(); // Close window and OpenGL context
110+
111+
// Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
112+
TraceLog(LOG_INFO, 'your first window is close and destroy');
113+
114+
115+
inherited Destroy;
116+
end;
117+
118+
var
119+
Application: TRayApplication;
120+
begin
121+
Application:=TRayApplication.Create(nil);
122+
Application.Title:=AppTitle;
123+
Application.Run;
124+
Application.Free;
125+
end.
126+

examples/extra/rayGizmo/raygizmos.lpi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
<FormatVersion Value="2"/>
2525
</RunParams>
2626
<RequiredPackages>
27-
<Item>
28-
<PackageName Value="ray4lazgizmo"/>
29-
</Item>
3027
<Item>
3128
<PackageName Value="ray4laz"/>
3229
</Item>

examples/extra/rayGizmo/raygizmos.lpr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
program raygizmos;
1+
program raygizmo;
22

33
{$mode objfpc}{$H+}
44

-2.34 MB
Binary file not shown.
Binary file not shown.
Binary file not shown.
2.67 MB
Binary file not shown.
-323 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

package/ray4laz.lpk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
3. This notice may not be removed or altered from any source distribution.
3232
"/>
3333
<Version Major="5" Minor="6"/>
34-
<Files Count="7">
34+
<Files Count="8">
3535
<Item1>
3636
<Filename Value="../source/raylib.pas"/>
3737
<UnitName Value="raylib"/>
@@ -60,6 +60,10 @@
6060
<Filename Value="../source/raylib.inc"/>
6161
<Type Value="Include"/>
6262
</Item7>
63+
<Item8>
64+
<Filename Value="../source/extras/raygizmo.pas"/>
65+
<UnitName Value="raygizmo"/>
66+
</Item8>
6367
</Files>
6468
<CompatibilityMode Value="True"/>
6569
<RequiredPkgs Count="1">

package/ray4laz.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
interface
99

1010
uses
11-
raylib, raymath, rlgl, raygui, reasings, raymedia;
11+
raylib, raymath, rlgl, raygui, reasings, raymedia, raygizmo;
1212

1313
implementation
1414

source/extras/rgizmo.pas renamed to source/extras/raygizmo.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unit rgizmo;
1+
unit raygizmo;
22
(*
33
Copyright (c) 2024 Claudio Z. (@cloudofoz)
44
https://github.com/cloudofoz/raylib-gizmo

source/extras/raymedia.pas

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,13 @@
55
{$ALIGN 8}
66
{$MINENUMSIZE 4}
77
// Include configuration file
8-
{$I ../raylib.inc}
8+
{$I raylib.inc}
99

1010

1111
interface
1212

1313
uses
1414
raylib;
15-
16-
{$IFNDEF RAY_STATIC}
17-
{$ifdef linux}
18-
const
19-
cDllName = 'librmedia.so';
20-
{$endif}
21-
{$endif}
22-
2315
type
2416
PMediaContext = ^TMediaContext;
2517
TMediaContext = pointer; //record end;
@@ -114,19 +106,6 @@ function GetMediaFlag(flag: Integer): Integer; cdecl; external {$IFNDEF RAY_STAT
114106
procedure UnloadMedia(media: PMediaStream); cdecl; external {$IFNDEF RAY_STATIC}cDllName{$ENDIF} name 'UnloadMedia';
115107

116108
implementation
117-
{$IFDEF linux}
118-
{$IFDEF RAY_STATIC}
119-
{$linklib c}
120-
{$linklib m}
121-
{$linklib dl}
122-
{$linklib pthread}
123-
{$linklib librmedia.a}
124-
{$linklib libavcodec}
125-
{$linklib libavformat}
126-
{$linklib libavutil}
127-
{$linklib libswresample}
128-
{$linklib libswscale}
129-
{$endif}
130-
{$endif}
109+
131110
end.
132111

0 commit comments

Comments
 (0)