News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

OpenAL include files

Started by zemtex, February 01, 2011, 02:24:30 AM

Previous topic - Next topic

zemtex

Hi.

I've desided to peek a little bit into OpenAL, i'm not entirely sure if it fits in this forum, but it is my best bet.

Is there a set of include files for MASM out there somewhere. I have downloaded OpenAL SDK and it is full of c++ "dirt". I converted it to include files by using "h2incx v0.99.20, copyright 2005-2009 japheth" but im not entirely sure if the files are fully usable.

Where to look, where to begin?
I have been puzzling with lego bricks all my life. I know how to do this. When Peter, at age 6 is competing with me, I find it extremely neccessary to show him that I can puzzle bricks better than him, because he is so damn talented that all that is called rational has gone haywire.

zemtex

Not an answer yet. Oh well, I have managed to get a hold of the include files

You can get the include files here if anyone wants to start coding openal in masm:

http://www.filedropper.com/openalincludefiles

..beware the file will automatically be deleted if not downloaded the last 30 days.
I have been puzzling with lego bricks all my life. I know how to do this. When Peter, at age 6 is competing with me, I find it extremely neccessary to show him that I can puzzle bricks better than him, because he is so damn talented that all that is called rational has gone haywire.

japheth

Quote from: zemtex on February 01, 2011, 02:24:30 AM
... but im not entirely sure if the files are fully usable.

Where to look, where to begin?

Yes, now you probably have an idea how I felt after I translated the huge Windows SDK to assembly include files.

There is no simple automated check if the output is "correct".

It has to be checked mostly "by hand". It's a very well-known phenomenon: doing a huge project is fun - the first 90% or even 95% of the work. The rest is veeerrrrryyyy boring - but it's exactly this boring rest which makes the difference between "hobby" and professional quality.

zemtex

Do you happen to have an example how to play a sound in a loop using openal?
I have been puzzling with lego bricks all my life. I know how to do this. When Peter, at age 6 is competing with me, I find it extremely neccessary to show him that I can puzzle bricks better than him, because he is so damn talented that all that is called rational has gone haywire.

zemtex

I will give it one more go before I abandon this thread. Do anyone have an example of how to play sounds using openAL?

I have the API here, I will use it if noone have an example. I'm just trying to save myself some time here.
I have been puzzling with lego bricks all my life. I know how to do this. When Peter, at age 6 is competing with me, I find it extremely neccessary to show him that I can puzzle bricks better than him, because he is so damn talented that all that is called rational has gone haywire.


ToutEnMasm

Hello,
I have downloaded the openal SDK with the upper link.
The samples can be build easily with the VC++ edition 2010.
Studying a little the problem,You need not only to translate the header's
files but also to know how to use a C++ class with masm.
You can got the full set of header's files following the link here.
http://www.masm32.com/board/index.php?topic=5428.0
To use the C++ class Cwaves with masm follow this link
http://www.masm32.com/board/index.php?topic=15750.0
If this failed you have to translate it in masm

In the sample,the framework is a set of four cpp files.
You need also how to use them with masm
Seems not to be an easy way to use masm.
If you re interested in such a work,I can help you



ToutEnMasm


A little more study give the easy way.
Each sample of this sdk use the framework who is compound of four objects
aldlist.obj CWaves.obj Framework.obj LoadOAL.obj
Just add those objects files to your masm object file at link time.
Lucky you are.The framework.cpp use the C++ class for you and you haven't  to deal with.
If one sample use a class function,the better way is to add a c++ function using it in the framework.cpp.
Doing that,you have just to call c++ fonctions with masm.
By defaut c function must be declare as PROTO C in masm.
To be successful, you need to build all the masm code nd the c++ code in the same environment.
Don't use the masm32 package to do that.
With the c++ express ,use the vsvars32.bat and call ml who is provided with it (ml 10...).




ToutEnMasm

As an end you must use the CRT and your code look like this
Quote
                ................
   includelib  libcmtd.lib ;msvcrt.lib
                extern c _FPinit:dword   ; to load floating point library
   ;avoid the R6002 floating point not loaded error     
..............
; Initialization and shutdown
       ?ALFWInit@@YAXXZ PROTO syscall
      ALFWInit TEXTEQU <?ALFWInit@@YAXXZ>
      ?ALFWShutdown@@YAXXZ PROTO syscall
      ALFWShutdown TEXTEQU <?ALFWShutdown@@YAXXZ>           

;################################################################
AlSourceCode PROC
   Local  uiBuffer:DWORD,uiSource,iState
   Local  retour:DWORD
   ; Initialize Framework
   invoke ALFWInit   
         mov retour,0
   invoke ALFWShutdown
FindeAlSourceCode:
         mov eax,retour
         ret
AlSourceCode endp

;################################################################

main PROC C argc:DWORD,pargv:DWORD
   ;pas de ExitProcess   ;la fin est dans la librairie c ainsi que le début
   invoke AlSourceCode         
   mov eax,0
   ret
main endp

end 

To get the name of the prototype,use DUMPBIN /ALL on the c++ obj file
Search for ALFWInit and you find
Quote
COMDAT; sym= "void __cdecl ALFWInit(void)" (?ALFWInit@@YAXXZ)
You have now all you need to know

zemtex

Thanks, i've had a break for a while now so I am not into programming atm.

Thanks anyway, I will keep this thread in the corner of my eye until i need it.  :clap:
I have been puzzling with lego bricks all my life. I know how to do this. When Peter, at age 6 is competing with me, I find it extremely neccessary to show him that I can puzzle bricks better than him, because he is so damn talented that all that is called rational has gone haywire.

ToutEnMasm


Here is the source sample playstatic , install the sdk OpenAL 1.1 SDK (else dll not found)

hfheatherfox07

Quote from: zemtex on February 01, 2011, 02:24:30 AM
Hi.

I've desided to peek a little bit into OpenAL, i'm not entirely sure if it fits in this forum, but it is my best bet.

Is there a set of include files for MASM out there somewhere. I have downloaded OpenAL SDK and it is full of c++ "dirt". I converted it to include files by using "h2incx v0.99.20, copyright 2005-2009 japheth" but im not entirely sure if the files are fully usable.

Where to look, where to begin?

Hi there I saw your post and I posted them for you here  a few days ago (did not know if you saw them) :

http://www.masm32.com/board/index.php?PHPSESSID=aec88b7b61971135943501fa333b535f&topic=17057.0

They were converted to MASM in 2007, they work like a charm , I also have Netwide Assembler (NASM)

ToutEnMasm

#12
Hello,
to hfheatherfox07 ,there is no link between SDK OpenAL (This thread) and your sample in OpenGL.Perhaps can you explain ???????

hfheatherfox07

Quote from: ToutEnMasm on July 20, 2011, 06:02:29 AM
Hello,
to hfheatherfox07 ,there is no link between SDK OpenAL (This thread) and your sample in OpenGL.Perhaps can you explain ???????


Sorry I read OpenGL I did not see OpenAL... Sorry about that,
non the less I posted some nice OpenGL Include files that I have not seen here...if anybody wants them

ToutEnMasm

#14
Hello,
This sample want to be a general sample on how to use various SDK
written in c++ code.
Best method to use a c++ class is to write a library in c++.
Standard c proc call the functions of the class.
Writing those functions is easy.
C++ Declarations are just copied from the sample in c++.
Those new functions are written with decorated name in the library.
To have the needed header you must follow this:
**** write a text file with the prototype in masm syntax
**** use this tool http://www.masm32.com/board/index.php?topic=17077.0
The c++ library must keep the general properties of the original c++ code.
I have put the c++ project here : OpenAL 1.1 SDK\samples\appel_cwave