Author Topic: Fun with Pixel Shaders and maths  (Read 2425 times)

felipe

  • Member
  • ****
  • Posts: 826
  • Eagles are just great!
Re: Fun with Pixel Shaders and maths
« Reply #30 on: April 08, 2018, 10:14:54 AM »
Siekmanski from the example d3d9_alpha.asm i get this error:

Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

 Assembling: ...\d3dx9_asm\sources\d3d9xAlpha\d3d9_al
pha.asm

***********
ASCII build
***********

\masm32\d3dx9includes\limits.inc(33) : error A2005: symbol redefinition : MB_LEN
_MAX
_
Assembly Error
...

I have added the folders of the includes and libs in the masm32 folder (d3dx9includes and d3dx9libs). Thanks for any help, it will be great to use the includes for directx9.
Felipe.

felipe

  • Member
  • ****
  • Posts: 826
  • Eagles are just great!
Re: Fun with Pixel Shaders and maths
« Reply #31 on: April 08, 2018, 10:22:36 AM »
I don't use the DirectX9 wrapper lib anymore and wrote my own libs to keep the executables very small.

Can you explain this a little bit please? If you want to do it here or in the game development forum is ok too.  :idea:
Felipe.

Siekmanski

  • Member
  • *****
  • Posts: 1487
Re: Fun with Pixel Shaders and maths
« Reply #32 on: April 08, 2018, 02:30:39 PM »
Quote
I have added the folders of the includes and libs in the masm32 folder (d3dx9includes and d3dx9libs). Thanks for any help, it will be great to use the includes for directx9.
The reason I included all includes and libs is because they are not exactly the same as in the Masm32 SDK from 2004.
So, it's better to keep them apart from the original ones from the Masm32 SDK.
The sources are 14 years old and based on the DirectX 9 SDK from late 2003.

You can download the latest DirectX9 End-User Runtimes,
DirectX End-User Runtimes (June 2010)
https://www.microsoft.com/en-us/download/details.aspx?id=8109

I don't use the DirectX9 wrapper lib anymore and wrote my own libs to keep the executables very small.

Can you explain this a little bit please? If you want to do it here or in the game development forum is ok too.  :idea:

Because I was fed up with the fact that the user needed the exact same DirectX 9 wrapper-lib version (d3dx9.lib, more than 20 different libs......) installed to run.
To prefent this I wrote my own math lib and picture/texture loader lib for Direct3D9.
My latest sources only need d3d9.lib (d3d9.dll) to work.
Those libs use SIMD instructions so, you might want to update your Masm Assembler to a more resent one.

Creative coders use backward thinking techniques as their strategy.

felipe

  • Member
  • ****
  • Posts: 826
  • Eagles are just great!
Re: Fun with Pixel Shaders and maths
« Reply #33 on: April 08, 2018, 02:48:12 PM »
Siekmanski: first point: ok thanks one last question: any tips to create include files for libraries like those of the directx9 sdk? What was your main procedure to do such thing that time? To the second point: amazing!  :icon14:
Thanks a lot one more time.  :icon14:
Felipe.

Siekmanski

  • Member
  • *****
  • Posts: 1487
Re: Fun with Pixel Shaders and maths
« Reply #34 on: April 08, 2018, 03:03:11 PM »
I translated it line by line myself, took a really long time.  :biggrin:
Creative coders use backward thinking techniques as their strategy.

felipe

  • Member
  • ****
  • Posts: 826
  • Eagles are just great!
Re: Fun with Pixel Shaders and maths
« Reply #35 on: April 08, 2018, 03:27:50 PM »
Code: [Select]
/*==========================================================================;
 *
 *  Copyright (C) Microsoft Corporation.  All Rights Reserved.
 *
 *  File:   d3d9.h
 *  Content:    Direct3D include file
 *
 ****************************************************************************/

#ifndef _D3D9_H_
#define _D3D9_H_

#ifndef DIRECT3D_VERSION
#define DIRECT3D_VERSION         0x0900
#endif  //DIRECT3D_VERSION

// include this file content only if compiling for DX9 interfaces
#if(DIRECT3D_VERSION >= 0x0900)


/* This identifier is passed to Direct3DCreate9 in order to ensure that an
 * application was built against the correct header files. This number is
 * incremented whenever a header (or other) change would require applications
 * to be rebuilt. If the version doesn't match, Direct3DCreate9 will fail.
 * (The number itself has no meaning.)*/

#ifdef D3D_DEBUG_INFO
#define D3D_SDK_VERSION   (32 | 0x80000000)
#define D3D9b_SDK_VERSION (31 | 0x80000000)

#else
#define D3D_SDK_VERSION   32
#define D3D9b_SDK_VERSION 31
#endif


#include <stdlib.h>

#define COM_NO_WINDOWS_H
#include <objbase.h>

#include <windows.h>

I see. I'm willing to do that, the problem is than i don't know how. Above is a little bit of the .h file of the d3d9. From the directx 9 sdk (which i believe is now freeware or something). I guess i will look to every include file in the masm package and compare with this .h files to undestand the syntax (actually i have never write a macro, maybe 1 very simple like an exercise or study and for 16 bits). Finally, if i really can't do this i guess i will give up with directx. I have searched in the fasm include from the main page and are very small and incompletes comparing with the ones of the masm package. So i really don't think there are other assemblers with includes for directx. Would be a good idea (just to do directx programming) to work with c to have this headers files working but using inline assembly all the time? Really don't want that, but can't think on more options by now. Ok good night and thanks again.  :icon14:
Felipe.

caballero

  • Member
  • ****
  • Posts: 973
    • Abre Ojos Ensamblador
Re: Fun with Pixel Shaders and maths
« Reply #36 on: April 10, 2018, 04:38:13 AM »
Why don't move this topic to the games thread that maybe should be named "graphics" and "games"? :t
En un lugar de la Mancha de cuyo nombre no quiero acordarme