Anders Jenbo
8626a48448
Update miniwin/src/d3drm/backends/opengl1/renderer.cpp
2025-07-02 00:25:14 +02:00
Anders Jenbo
6668d185d4
Make OpenGL 1.1 renderer work under PSP
2025-07-01 23:59:29 +02:00
Joshua Peisach
1ff768935e
3DS Port ( #450 )
...
* [WIP] 3ds port
Recommit of everything after the 2d renderer merge
* VERY AWESOME FEATURE FRFR
* Stopped CPU suicide and app crashing for now
* put in Texture3DS function thing
* Fix clear color
* Implement 2D rendering via Citro3D
* Set 3dsx smdh metadata
* Render world content, sort of
* Push mesh dynamically
* Remove Citro3D init hacks
* Clean up Citro3D implementation
* Try to upload meshes and convert matricies
* Fix 3D rendering
* Apply optimizations
* Implement lighting
* Set 3dsx smdh metadata
* Revert "Apply optimizations"
This reverts commit 6660082fef .
* Apply optimizations
* Added a cleaner icon (#4 )
* Fix pure buffer clear frames (#9 )
* Disable OpenGL on 3DS (#10 )
* Fix tiled textures and improve UI image quality (#11 )
* Create 3DS default config overrides
* 3ds: implement apt hooks
* remove unused import
* Apply suggestions from code review
Co-authored-by: Christian Semmler <mail@csemmler.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
* Update miniwin/src/d3drm/backends/citro3d/renderer.cpp
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
* Separate 3DS apt hook code + move cmake 3ds into ISLE_BUILD_APP
* miniwin: use citro3dd if debugging
* Optimize texture encoding (#12 )
* Cleanup
* Set correct mipmap level for UI textures (#13 )
* cpack: include the .3dsx
* Add 3DS CI
* Fix CI
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
* syntax
* Refactor c3d renderer (#14 )
* Refactor c3d renderer
* format
* Apply suggestions from code review
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
---------
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
* n3ds: just distribute the .3dsx
* upload 3dsx
* Skip uploading 3DS artifacts
* Update ci.yml
* Update ci.yml
* Remove extraneous ifdef
---------
Co-authored-by: MaxBrick <maximusbrick@gmail.com>
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
Co-authored-by: Steven <139715581+StevenSYS@users.noreply.github.com>
Co-authored-by: Christian Semmler <mail@csemmler.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2025-07-01 02:43:10 +00:00
Anders Jenbo
586327b584
Destry shader before the context ( #463 )
2025-07-01 04:15:02 +02:00
Anders Jenbo
e2ff65cf91
Expose window during device probing ( #462 )
2025-07-01 02:23:13 +02:00
Anders Jenbo
ab48ce60b0
OpenGL ES 2.0 Only lookup shader locations once ( #460 )
2025-06-30 23:38:44 +02:00
Anders Jenbo
225adda309
Rendering refactoring ( #459 )
...
* Hint texture intent to renderer
* improve transparancy for 32bit rendering
* Align OpenGL ES 2.0 with SDL_GPU's 2D rendering
2025-06-30 22:51:26 +02:00
David Gow
e87184b502
Fix the OpenGL backends on non-glx Linux platforms (and remove GLEW dependency) ( #446 )
...
* Work around issues with depth-buffer size on EGL-based platforms
The OpenGL 1.1 and OpenGL ES 2.0 backends can break on EGL-based platforms,
such as Wayland, or X11 with SDL_VIDEO_FORCE_EGL=1. One of the reasons for
this (the other being glew on the GL1.1 backend) is that SDL/egl get very
confused by the way we set OpenGL attributes, particularly SDL_GL_DEPTH_SIZE,
resulting in SDL_GL_CreateContext() failing with EGL_BAD_MATCH.
The exact cause of this is unknown, but it seems to be a combination of:
- SDL_GL_SetAttribute() is supposed to be called _before_ the window is
created, and we're calling it afterward.
- Creating several test windows during the enumeration process, mixing
and matching between OpenGL and OpenGL ES profiles.
The "most correct" solution is probably to delay creating the game window
until the backend creation process, rather than before the enumeration
occurs. But that's a real refactor, which could cause other issues.
Instead, set the 24-bit bit depth (which we've hardcoded anyway) before
creating the window, and use SDL_GL_ResetAttributes() when creating backends.
This seems to work here in all of the cases I was able to try (modulo the GLEW
dependency, which is removed in the next patch).
* miniwin: Remove GLEW dependency for OpenGL 1.1
GLEW normally backs directly onto glXGetProcAddress on Linux, which is broken
on non-GLX setups, such as Wayland (but also X11 with EGL, and presumably KMSDRM).
Replace it with manual calls to SDL_GL_GetProcAddress() for the VBO path.
Note, however, that SDL_opengl.h includes "windows.h", so conflicts with the
miniwin implementation, which breaks builds on windows.
In order to work around this, we do what the Direct3D9 implementation does and
push all of the OpenGL calls to a separate file, actual.cpp.
Going forward, it may make sense to load _all_ OpenGL entry points via SDL,
which would allow us to avoid linking directly with libGL/libOpenGL, and
therefore eliminate the separate build dependency altogether, as well as
allowing more runtime configurability as to the OpenGL library to load.
(But that's definitely a bit uglier, and also useful very rarely.)
2025-06-29 17:47:09 +02:00
Danct12
a782c48980
miniwin: Use PRIu32 for printing uint32_t ( #436 )
...
Some architecture uses different type for uint32_t.
For example:
x86_64 | aarch64 = unsigned int
xtensa | riscv32 = long unsigned int
arm = long unsigned int
2025-06-26 19:41:46 +02:00
Anders Jenbo
dcacdcc711
Fix d3drmmesh type error ( #433 )
2025-06-26 02:46:10 +02:00
Anders Jenbo
b65284a7a0
Move 2D drawing and upscaling to the renderer ( #348 )
2025-06-25 19:45:26 +02:00
Anders Jenbo
c8bb0da5a7
Implement DrawFPS ( #420 )
2025-06-23 21:04:52 +00:00
dcd4262f76
miniwin: fix OpenGL include on macOS ( #350 )
2025-06-20 22:54:05 +02:00
Anders Jenbo
ff03ffcc5a
Correct types for IDirect3DRMMesh::AddGroup ( #345 )
2025-06-19 04:55:33 +00:00
Anders Jenbo
6b2db2d85b
Correct some types for IDirect3DRMMesh ( #344 )
2025-06-19 04:40:03 +00:00
Anders Jenbo
a0c896a0b8
Fix a couple of memory leaks ( #342 )
2025-06-19 03:55:22 +00:00
Anders Jenbo
ea4b9ab1c9
Implement DirectX 9 backend ( #332 )
2025-06-18 18:10:48 +02:00
Anders Jenbo
e9c5e5b9ba
Use extensions to probe for 24 or 32bit depth buffer ( #329 )
2025-06-17 17:50:36 +02:00
Christian Semmler
3cfa3f5bec
Hotfix: reserve instead of resize
2025-06-16 21:00:12 -07:00
Christian Semmler
83205e2e4e
Fix UB in software renderer ( #322 )
...
* Fix UB in software renderer
One cannot access elements of the vector that don't exist. `reserve` allocates memory, but doesn't add elements.
`D3DRMVERTEX& dst = m_transformedVerts[i];` is UB and crashes on Windows debug build
* Update renderer.cpp
2025-06-17 05:25:34 +02:00
Anders Jenbo
0cfcc0fb21
Fix zawtooths during late game stage ( #325 )
2025-06-17 05:02:24 +02:00
Anders Jenbo
eab95514d6
Add an OpenGL ES 2.0 renderer ( #287 )
2025-06-17 03:47:23 +02:00
Anders Jenbo
1689a0063f
Fix an optimiaze OpenGL rendere ( #320 )
...
Co-authored-by: Christian Semmler <mail@csemmler.com>
2025-06-16 19:49:17 +02:00
Anders Jenbo
79726d25a4
Split framebuffer from general surfaces ( #319 )
2025-06-16 18:11:56 +02:00
Anders Jenbo
2828452b35
Clean up rendering ( #301 )
2025-06-16 04:28:32 +02:00
Anders Jenbo
4c80c8d923
Add 32bit color support ( #311 )
2025-06-14 23:09:23 +00:00
Anders Jenbo
65aafd2f44
Implement some minor functions in miniwin ( #310 )
2025-06-14 22:00:44 +02:00
Anders Jenbo
975764dc17
Align OpenGL and SDL_GPU specular with software ( #305 )
2025-06-14 18:05:25 +02:00
Anders Jenbo
d06caa99cb
Dial software speculare color in to match the original as best possible ( #302 )
2025-06-14 16:52:08 +02:00
Anders Jenbo
81ba75ea65
SIMD optimize z-buffer clear ( #283 )
2025-06-13 01:21:34 +02:00
Christian Semmler
5080e372f9
Emscripten port ( #229 )
...
* Emscripten port
* Fix NCC
* Update CMakeLists.txt
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
* Update CMakeLists.txt
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
* Update CMakeLists.txt
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
* Update CMakeLists.txt
* cmake: set iniparser cmake options in local scope
* ci: try adding emscripten to test matrix
* cmake: try to make CMake install package more usable
* cmake: fix typo
* Update CMakeLists.txt
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
* Add support for .ini loading
* Different default full screen behavior for Emscripten
* Add comments
* Add web platform
---------
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
2025-06-13 00:26:43 +02:00
Anders Jenbo
bbb0de6e9a
Implement full screen ( #290 )
2025-06-12 22:51:52 +02:00
Christian Semmler
b95ca4b2a3
Fix m_callbacks resource issue ( #289 )
2025-06-12 21:37:51 +02:00
Anders Jenbo
4374453cb7
Align cache destruction callback in software renderer ( #284 )
2025-06-12 01:45:07 +02:00
Anders Jenbo
d06972cfb5
Some sanity checks on Direct3DRMObjectBaseImpl::Release() ( #285 )
2025-06-11 22:18:56 +00:00
Anders Jenbo
7732a3ccfd
Use edge walking for triangle rasterization ( #280 )
2025-06-11 21:56:12 +02:00
Anders Jenbo
b2354a85d0
Sort and render transparent objects last ( #277 )
2025-06-11 02:15:26 +02:00
Anders Jenbo
2c9d9ba920
Upload mesh data to GPU using VBOs when available ( #275 )
2025-06-10 23:33:14 +00:00
Anders Jenbo
4c5b255471
Use indexed triangles in SDL_GPU ( #274 )
2025-06-10 23:07:02 +02:00
Anders Jenbo
c8b8035de8
Upload models to GPU before rendering ( #272 )
2025-06-10 06:34:49 +02:00
Anders Jenbo
08c654bf60
Simplify access to groups internally ( #270 )
2025-06-09 21:42:24 +02:00
Anonymous Maarten
7e9acc8d04
Add IDirect3DRMMiniwinDevice interface ( #267 )
2025-06-09 16:34:37 +00:00
Anders Jenbo
42e732192c
Fix Pick() ( #268 )
2025-06-09 16:32:11 +02:00
Anders Jenbo
de82e8477a
Use dedicated path for flat shading ( #248 )
2025-06-09 05:06:19 +02:00
Anders Jenbo
cd4a24ec9e
Use indexed faces ( #257 )
2025-06-09 04:56:29 +02:00
Anders Jenbo
5be9b09b40
SDL3 GPU texture support ( #254 )
...
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
2025-06-09 01:04:19 +02:00
Christian Semmler
1a91547011
Update legomodelpresenter.cpp ( #264 )
...
* Update legomodelpresenter.cpp
* Update renderer.cpp
2025-06-08 15:55:35 -07:00
Anders Jenbo
f3a4d8fcb5
Fix OpenGL rendering ( #262 )
2025-06-08 23:44:37 +02:00
Anders Jenbo
4cd0385c38
Some cleanups for the software rendere ( #261 )
2025-06-08 23:31:29 +02:00
Anders Jenbo
6bdcc16fd9
Turn things right side in on SDL_GPU ( #260 )
2025-06-08 23:20:43 +02:00
Anders Jenbo
ee372fbc8f
Replace GeometryVertex with D3DRMVERTEX ( #259 )
2025-06-08 23:06:38 +02:00
Anders Jenbo
d32c30492f
Add flat shading to Appearance ( #258 )
2025-06-08 22:40:14 +02:00
David Gow
43191c7530
miniwin: Use the GLEW::GLEW target to find glew. ( #246 )
...
On some systems, the old-style GLEW_TARGET_LIBRARIES variable is not set by
find_package(GLEW), and instead we must use the newer GLEW::GLEW target, as
we do for OpenGL.
This fixes a build error on openSUSE Tumbleweed, which has a glew CMake config
in /usr/lib64/cmake/glew/glew-config.cmake.
2025-06-06 17:42:50 +02:00
Anders Jenbo
4c44f8f081
Update size to match vector content ( #245 )
2025-06-06 17:36:18 +02:00
Anders Jenbo
06fb577d7f
Big performance boost ( #242 )
2025-06-06 03:08:38 +02:00
Anders Jenbo
9a1cf812dd
Enable backface culling ( #241 )
2025-06-06 01:49:47 +02:00
Anders Jenbo
874cc526be
Add texture support for OpenGL ( #239 )
2025-06-05 13:26:06 +02:00
Anders Jenbo
12d01ae311
Refactor renderers ( #237 )
2025-06-05 04:07:42 +02:00
Anders Jenbo
39408b3584
Viewport cleanup ( #233 )
2025-06-04 22:31:38 +02:00
Anders Jenbo
956e3f2765
Cull by Bounding Box ( #231 )
2025-06-04 16:10:27 +02:00
Anders Jenbo
72eb992af4
Make Lego Islan Fully playable ( #230 )
2025-06-04 05:42:42 +02:00
Anders Jenbo
0ac7fee23c
Renderer clean up ( #228 )
2025-06-04 02:21:06 +02:00
Anders Jenbo
e349842ea4
Make Pick() more picky ( #227 )
2025-06-03 22:11:50 +02:00
Anders Jenbo
f412d44f83
Config clean ups ( #226 )
2025-06-03 20:08:09 +02:00
Anders Jenbo
85e8c2e42a
Cache bounding box ( #225 )
2025-06-03 19:30:25 +02:00
Anders Jenbo
d5a6da31e3
Make OpenGL compatible with config ( #224 )
2025-06-03 19:13:03 +02:00
Joshua Peisach
e520a47e2f
Port CONFIG to Qt ( #210 )
...
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2025-06-03 03:48:04 +02:00
Anders Jenbo
b169a4d637
Implement OpenGL 1.5 backend renderer ( #223 )
2025-06-03 03:28:53 +02:00
AllMeatball
1ab11ed091
miniwin: Compartmentalize EnumDevices ( #222 )
...
This compartmentalizes everything to a corresponding function
for each renderer backend.
2025-06-03 02:18:20 +02:00
Anders Jenbo
2affbdfcc7
Align hardware lighting with software ( #221 )
2025-06-03 02:16:33 +02:00
Anders Jenbo
f08aec7438
Add highlights to software rendering ( #218 )
2025-06-02 04:14:40 +02:00
Anders Jenbo
5375336b5a
Pass material shininess to the renderer ( #217 )
2025-06-02 02:09:17 +02:00
Anders Jenbo
de8a7c2d91
Correct status of Direct3DRMTextureImpl::Direct3DRMTextureImpl(IDirectDrawSurface* surface)
2025-06-02 02:09:04 +02:00
Anders Jenbo
31235de706
Correct normal transformations ( #216 )
2025-06-02 01:40:19 +02:00
Anders Jenbo
ec7204ed38
Add texture rendering to the software rendere ( #211 )
2025-06-01 05:21:59 +02:00
Anders Jenbo
403ead7453
Push textures to the rendere ( #209 )
2025-05-31 23:48:20 +02:00
Anders Jenbo
613e5b8d9f
Add lighting for software renderer ( #205 )
2025-05-31 03:28:00 +02:00
Anders Jenbo
0ab5070b46
software: Add support for transparent surfaces ( #201 )
...
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2025-05-31 02:41:09 +02:00
Anders Jenbo
f6c9eaa006
Fix bad normals ( #206 )
2025-05-31 02:39:21 +02:00
Anders Jenbo
6afb7626a0
Add lighting ( #200 )
...
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2025-05-31 01:12:54 +02:00
Anders Jenbo
341d06f997
Pass the image data to the textures ( #202 )
2025-05-30 17:41:06 +02:00
Anders Jenbo
91e72261d0
Apply clipping and culling on hardware ( #198 )
2025-05-29 20:28:01 +02:00
Anders Jenbo
f1bf52db4c
Fix sky color ( #196 )
2025-05-29 19:14:06 +02:00
Anders Jenbo
4abd404f2d
Implement Software rendering
2025-05-29 04:08:01 +02:00
Anders Jenbo
ef7499bdb9
Restructure miniwin and add support for 3D backends
2025-05-29 04:07:53 +02:00
Christian Semmler
ddba1bc5c1
Fix DirectDrawPalette_SDL3GPUImpl::SetEntries ( #189 )
2025-05-28 18:22:24 -07:00
Anonymous Maarten
8f8bf3142e
Fix color space of SDL3_gpu texture ( #188 )
2025-05-28 03:40:46 +00:00
Anonymous Maarten
19f1bedd16
Add depth buffer ( #185 )
...
* Add depth buffer and calcuate normals
* Forgot do divide with the determinant
* Address review
2025-05-27 19:44:37 -07:00
Anders Jenbo
6bbddf5508
Implement Viewport::Pick() ( #183 )
2025-05-26 22:07:57 -07:00
Anders Jenbo
4e3cf45aba
Implement Direct3DRMPickedArray constructor ( #181 )
2025-05-26 07:39:43 -07:00
Anonymous Maarten
e1cddc5c0e
Move DirectDraw entry functions to backends ( #178 )
2025-05-26 01:33:39 +00:00
Anders Jenbo
3df6be1122
Correct FOV calculation ( #176 )
...
* Correct FOV calculation
* Update miniwin/sdl3gpu/src/miniwin_d3drmviewport.cpp
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
---------
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2025-05-26 01:09:41 +00:00
AllMeatball
b1a04f43ff
Make FOV perspective work better ( #174 )
...
* Add camera position to the rendering
* Rebase with anders' camera code
* Add perspective matrix
* Add (at least) a better fov
* Fix formatting
* Zero out matrix in perspective function
* Fix formatting again
* Make functions static in D3DRM viewport code
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
* Implement GetGroupMaterial() (#175 )
* Fix naming conflict
* Fix conflict in HMM_Perspective_LH_NO
* Fix formating
---------
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2025-05-25 15:57:51 -07:00
Anders Jenbo
343bbbd563
Add camera position to the rendering ( #173 )
2025-05-25 22:36:04 +00:00
Anders Jenbo
cea10248aa
Implement GetGroupMaterial() ( #175 )
2025-05-25 14:35:02 -07:00
Anonymous Maarten
48958c304e
Verbose logging and static multiply ( #172 )
...
* Log SDL3GPU device creation errors
* Give D3DRMMatrixMultiply static visibility
2025-05-25 20:16:48 +00:00
Anders Jenbo
0fe44b28b8
Set viewport frustrum again ( #171 )
2025-05-25 20:03:13 +00:00
Anonymous Maarten
b24271a51b
Move miniwin to sdl3gpu subdirectory + add suffix to classes ( #170 )
2025-05-25 17:38:02 +00:00
Anders Jenbo
f2a4ce9353
Apply 3D transformations ( #168 )
2025-05-25 07:26:22 -07:00
Anders Jenbo
c6e5e10921
Implement IDirect3DRM2::CreateMaterial() ( #167 )
2025-05-25 06:53:58 -07:00