This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository direct3d.
View the commit online.
commit c4884fe7ec350971d4e6b0a93aab3bde501c85d0
Author: Vincent Torri <vto...@outlook.fr>
AuthorDate: Tue Apr 16 07:39:07 2024 +0200
add script to compile everything, modify object_free() declaration
---
configure.sh | 12 ++++++++++++
src/d3d_0.c | 34 ++++++++++++++++++----------------
src/d3d_1.c | 2 +-
src/d3d_2.c | 6 +++---
src/d3d_3.c | 6 +++---
src/d3d_4.c | 6 +++---
src/d3d_5.c | 6 +++---
src/d3d_6.c | 6 +++---
8 files changed, 46 insertions(+), 32 deletions(-)
diff --git a/configure.sh b/configure.sh
new file mode 100644
index 0000000..659a8db
--- /dev/null
+++ b/configure.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+cd src
+
+gcc -g -O2 -Wall -Wextra -o d3d_0 d3d_0.c win.c -ld3d11 -ld3dcompiler -ldxgi /c/Windows/system32/DXGIDebug.dll -ldxguid -luuid -D_WIN32_WINNT=0x0A00
+gcc -g -O2 -Wall -Wextra -o d3d_1 d3d_1.c win.c -ld3d11 -ld3dcompiler -ldxgi /c/Windows/system32/DXGIDebug.dll -ldxguid -luuid -D_WIN32_WINNT=0x0A00
+gcc -g -O2 -Wall -Wextra -o d3d_2 d3d_2.c win.c -ld3d11 -ld3dcompiler -ldxgi /c/Windows/system32/DXGIDebug.dll -ldxguid -luuid -D_WIN32_WINNT=0x0A00
+gcc -g -O2 -Wall -Wextra -o d3d_3 d3d_3.c win.c -ld3d11 -ld3dcompiler -ldxgi /c/Windows/system32/DXGIDebug.dll -ldxguid -luuid -D_WIN32_WINNT=0x0A00
+gcc -g -O2 -Wall -Wextra -o d3d_4 d3d_4.c win.c -ld3d11 -ld3dcompiler -ldxgi /c/Windows/system32/DXGIDebug.dll -ldxguid -luuid -D_WIN32_WINNT=0x0A00
+gcc -g -O2 -Wall -Wextra -o d3d_5 d3d_5.c win.c -ld3d11 -ld3dcompiler -ldxgi /c/Windows/system32/DXGIDebug.dll -ldxguid -luuid -D_WIN32_WINNT=0x0A00
+gcc -g -O2 -Wall -Wextra -o d3d_6 d3d_6.c win.c -ld3d11 -ld3dcompiler -ldxgi /c/Windows/system32/DXGIDebug.dll -ldxguid -luuid -D_WIN32_WINNT=0x0A00
+gcc -g -O2 -Wall -Wextra -o d3d_7 d3d_7.c win.c -ld3d11 -ld3dcompiler -ldxgi /c/Windows/system32/DXGIDebug.dll -ldxguid -luuid -D_WIN32_WINNT=0x0A00
diff --git a/src/d3d_0.c b/src/d3d_0.c
index 42bcaf4..be3069c 100644
--- a/src/d3d_0.c
+++ b/src/d3d_0.c
@@ -5,11 +5,12 @@
*
* Compilation:
*
- * gcc -g -O2 -Wall -Wextra -o d3d_0 d3d_0.c win.c -ld3d11 -ldxgi -luuid -D_WIN32_WINNT=0x0A00
+ * gcc -g -O2 -Wall -Wextra -o d3d_0 d3d_0.c win.c -ld3d11 -ld3dcompiler -ldxgi /c/Windows/system32/DXGIDebug.dll -ldxguid -luuid -D_WIN32_WINNT=0x0A00
*/
-#include <stdlib.h> /* calloc() free() */
-#include <stdio.h> /* printf() fflush() */
+#include <stdlib.h> /* calloc() free() */
+#include <stdio.h> /* printf() fflush() */
+#include <string.h> /* strlen() */
#define _DEBUG
@@ -19,14 +20,15 @@
#include <dxgi1_3.h> /* DXGI interface */
#include <d3d11.h> /* D3D11 interface */
#include <d3dcompiler.h> /* compilation of shader */
+#include <dxgidebug.h> /* IDXGIDebug interface */
#include "win.h"
#ifdef _DEBUG
-# define FCT \
+# define DBG_FCT \
do { printf(" * %s\n", __FUNCTION__); fflush(stdout); } while (0)
#else
-# define FCT \
+# define DBG_FCT \
do { } while (0)
#endif
@@ -45,10 +47,10 @@ D3d *d3d_init(Window *win, int vsync)
if (!d3d)
return NULL;
- return d3d;
+ d3d->vsync = vsync;
+ win->d3d = d3d;
- (void)win;
- (void)vsync;
+ return d3d;
}
void d3d_shutdown(D3d *d3d)
@@ -59,6 +61,14 @@ void d3d_shutdown(D3d *d3d)
free(d3d);
}
+void d3d_resize(D3d *d3d, int rot, UINT width, UINT height)
+{
+ (void)d3d;
+ (void)rot;
+ (void)width;
+ (void) height;
+}
+
void d3d_scene_begin(D3d *d3d)
{
(void)d3d;
@@ -68,14 +78,6 @@ void d3d_scene_end(void)
{
}
-void d3d_resize(D3d *d3d, int rot, UINT width, UINT height)
-{
- (void)d3d;
- (void)rot;
- (void)width;
- (void) height;
-}
-
void d3d_render(D3d *d3d)
{
(void)d3d;
diff --git a/src/d3d_1.c b/src/d3d_1.c
index 56d1af6..1e895cf 100644
--- a/src/d3d_1.c
+++ b/src/d3d_1.c
@@ -7,7 +7,7 @@
*
* Compilation:
*
- * gcc -g -O2 -Wall -Wextra -o d3d_1 d3d_1.c win.c -ld3d11 -ldxgi /c/Windows/system32/DXGIDebug.dll -ldxguid -luuid -D_WIN32_WINNT=0x0A00
+ * gcc -g -O2 -Wall -Wextra -o d3d_1 d3d_1.c win.c -ld3d11 -ld3dcompiler -ldxgi /c/Windows/system32/DXGIDebug.dll -ldxguid -luuid -D_WIN32_WINNT=0x0A00
*/
#include <stdlib.h> /* calloc() free() malloc() */
diff --git a/src/d3d_2.c b/src/d3d_2.c
index 1e2dfbe..ed4aadd 100644
--- a/src/d3d_2.c
+++ b/src/d3d_2.c
@@ -625,13 +625,13 @@ Object *triangle_new(D3d *d3d,
return o;
}
-void object_free(void *o)
+void object_free(Object *o)
{
if (!o)
return ;
- ID3D11Buffer_Release(((Object *)o)->index_buffer);
- ID3D11Buffer_Release(((Object *)o)->vertex_buffer);
+ ID3D11Buffer_Release(o->index_buffer);
+ ID3D11Buffer_Release(o->vertex_buffer);
free(o);
}
diff --git a/src/d3d_3.c b/src/d3d_3.c
index 1223633..486a376 100644
--- a/src/d3d_3.c
+++ b/src/d3d_3.c
@@ -670,13 +670,13 @@ Object *triangle_new(D3d *d3d,
return o;
}
-void object_free(void *o)
+void object_free(Object *o)
{
if (!o)
return ;
- ID3D11Buffer_Release(((Object *)o)->index_buffer);
- ID3D11Buffer_Release(((Object *)o)->vertex_buffer);
+ ID3D11Buffer_Release(o->index_buffer);
+ ID3D11Buffer_Release(o->vertex_buffer);
free(o);
}
diff --git a/src/d3d_4.c b/src/d3d_4.c
index e5ff3ec..10df823 100644
--- a/src/d3d_4.c
+++ b/src/d3d_4.c
@@ -689,13 +689,13 @@ Object *triangle_new(D3d *d3d,
return o;
}
-void object_free(void *o)
+void object_free(Object *o)
{
if (!o)
return ;
- ID3D11Buffer_Release(((Object *)o)->index_buffer);
- ID3D11Buffer_Release(((Object *)o)->vertex_buffer);
+ ID3D11Buffer_Release(o->index_buffer);
+ ID3D11Buffer_Release(o->vertex_buffer);
free(o);
}
diff --git a/src/d3d_5.c b/src/d3d_5.c
index 6916f9d..416d79b 100644
--- a/src/d3d_5.c
+++ b/src/d3d_5.c
@@ -804,13 +804,13 @@ Object *rectangle_new(D3d *d3d,
return o;
}
-void object_free(void *o)
+void object_free(Object *o)
{
if (!o)
return ;
- ID3D11Buffer_Release(((Object *)o)->index_buffer);
- ID3D11Buffer_Release(((Object *)o)->vertex_buffer);
+ ID3D11Buffer_Release(o->index_buffer);
+ ID3D11Buffer_Release(o->vertex_buffer);
free(o);
}
diff --git a/src/d3d_6.c b/src/d3d_6.c
index db89da3..92f82f3 100644
--- a/src/d3d_6.c
+++ b/src/d3d_6.c
@@ -763,13 +763,13 @@ Object *rectangle_new(D3d *d3d,
return o;
}
-void object_free(void *o)
+void object_free(Object *o)
{
if (!o)
return ;
- ID3D11Buffer_Release(((Object *)o)->index_buffer);
- ID3D11Buffer_Release(((Object *)o)->vertex_buffer);
+ ID3D11Buffer_Release(o->index_buffer);
+ ID3D11Buffer_Release(o->vertex_buffer);
free(o);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.