Author Topic: Hello, people.  (Read 35331 times)

MrTAToad

  • Guest
Re: Hello, people.
« Reply #15 on: 2009-Dec-08 »
It is - but you need to use IMPORT or DECLARE in order to get access to the BASS API.  Its quite simple really.

Offline com_1

  • Mr. Drawsprite
  • **
  • Posts: 80
  • no comment
    • View Profile
Re: Hello, people.
« Reply #16 on: 2009-Dec-09 »
I tried to connect "Bass.dll" and GLBasic, but nothing.

> DLL - Funktionen ansprechen

> Von Hand laden:
> // Lädt die Funktion "foo" aus my.dll in den Zeiger: foo
> void (__stdcall* foo)(int, char); // Deklaration
> void LoadDllFunction()
> {
>    DLLCALL("my.dll", "foo", (void**) &foo);
> }


How it can be understood ?

> Automatisch laden lassen:

> // ausserhalb von Funktionen:
> // DECLARE(name, "dll", (parameter), rückgabetyp)
> DECLARE(foo, "my.dll", (int, char), void);

> // DECLARE_ALIAS(name, "dll", "echter_name", (parameter), rückgabewert)
> DECLARE_ALIAS(foo, "my.dll", "foo@4", (int, char), void);


How it can be understood ?

> Wenn die Funktion eine __cdecl Funktion ist (also kein __stdcall), hängt man an DECLARE ein _C an:

> DECLARE_C(foo, "my.dll", (int, char), void);
> DECLARE_C_ALIAS(foo, "my.dll", "foo@4", (int, char), void);


How it can be understood ?


I need a simple working - "Inline" code.

Please, help.

MrTAToad

  • Guest
Re: Hello, people.
« Reply #17 on: 2009-Dec-09 »
Most people here use FMOD (as it supports more operating systems), and there is a small sample program on using FMOD in the samples directory.

Put simply the DECLARE statement allows the GLBasic program to access a DLL by defining the function name, parameters it takes and the return value (if any)

Offline com_1

  • Mr. Drawsprite
  • **
  • Posts: 80
  • no comment
    • View Profile
Re: Hello, people.
« Reply #18 on: 2010-Feb-01 »
Gernot - a question ?

"Include" - is that possible on GLBasic ?
If yes then - how ? (example, please)

And thanks for GLBasic (SDK version) - Gernot.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10753
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Hello, people.
« Reply #19 on: 2010-Feb-01 »
include works in inline. You must, however, get the headerpack. But I fear you won't like to link libraries as they must match the compiler. What are you trying to wrap? FMOD?

Please post a link to the FMOD API. I'll make you an example wrapper.

Offline com_1

  • Mr. Drawsprite
  • **
  • Posts: 80
  • no comment
    • View Profile
Re: Hello, people.
« Reply #20 on: 2010-Feb-01 »
Gernot - I just want to build "Media Player" on GLBasic.

I have no time, no desire, to learn "C++" and "DLL" in GLBasic. (I thought that would include easier and faster.)
I need only Tutorials. (How does one reconcile FMOD with GLBasic)

Only Tutorials - Gernot. (maybe this can help)
http://www.genesis3d.com/~wog/tutorials/prog_gtestfmodsound/gtestfmodsound.htm



Gernot - Wir möchten nur "Media Player" auf GLBasic bauen.

Wir haben keine zeit und lust ("C++" und "GLBasic DLL" structure) lernen.
Wir haben gedacht - "include" wird besser und schneller.
Wir brauchen nur Tutorials. (wie kann man FMOD in GLBasic einfügen)

Nur Tutorials - Gernot. (Vielleicht das kann helfen)
http://www.genesis3d.com/~wog/tutorials/prog_gtestfmodsound/gtestfmodsound.htm

MrTAToad

  • Guest
Re: Hello, people.
« Reply #21 on: 2010-Feb-01 »
Have a look at the FMOD gbas file...

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10753
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Hello, people.
« Reply #22 on: 2010-Feb-02 »
Yes. Why aren't you trying the FMOd wrapper:

Samples/_Projects_/fmod_player was it.

Offline com_1

  • Mr. Drawsprite
  • **
  • Posts: 80
  • no comment
    • View Profile
Re: Hello, people.
« Reply #23 on: 2010-Feb-02 »
Er(com_1) hat schon "FMOD - beispiel" gesehen.
Versucht was umbenennen oder überschreiben aber .....

GLBasic - ist seine(com_1) erste sprache.

Er spricht kein "C++".
Wie kann man was schreiben, wenn wir verstehen nichts.

Wir brauchen nur antwort von Ihnen.
Haben Sie lust " (FMOD in GLBasic) Tutorial (seit 0)" schreiben oder nicht ?

If "keine lust" then
print "Das ist die letzte FMOD frage"
endif


Sonst, er(com_1) macht nächste "kub" version.(erscheinungstermin: hoffentlich bis sommer)

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5069
  • O Rly?
    • View Profile
Re: Hello, people.
« Reply #24 on: 2010-Feb-02 »
Take a look at this topic ;) -> http://www.glbasic.com/forum/index.php?topic=2678.msg19891#msg19891

I can help you a bit. If you have some problems, let me know that on a PM ;)
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10753
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Hello, people.
« Reply #25 on: 2010-Feb-03 »
com_1: Schau das Beispiel "fmod_player" an. Bitte schließe die Datei "fmod.gbas", das ist die Bibliothek dazu. Diese Datei muss nur im Projekt sein. Die andere Datei "player_interface" ist ein Beispiel wie man FMOD startet:
Code: (glbasic) [Select]
snd$ = "rb_1.it"
good = FMod_Load(snd$)
FMod_Play()
FMod_SetMasterVolume(1.0) // full volume / Volle Lautstärke


WHILE TRUE
PRINT "PLAY: "+snd$ + " returns: "+good, 100,100
PRINT "IsFinished: " + FMod_IsFinished(), 100, 120

PRINT "click mouse to stop", 100,140
IF MOUSEAXIS(3) THEN BREAK
SHOWSCREEN
WEND

FMod_Stop()

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5069
  • O Rly?
    • View Profile
Re: Hello, people.
« Reply #26 on: 2010-Feb-03 »
Ja das mag gehen Gernot, nur hast du keinen MP3 Support mit drin ;)
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10753
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Hello, people.
« Reply #27 on: 2010-Feb-03 »
hat FMod kein MP3?
Ja... blöd.

Welche DLL hat denn MP3? Kann mir bitte einer so eine DLL mit SDK zeigen, dass wir das kurz wrappen?


Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10753
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Hello, people.
« Reply #29 on: 2010-Feb-03 »
OK, read this tutoral here:
http://www.glbasic.com/forum/index.php?topic=2129.0

I'll wrap one function for you, so you get the point.

1. Open the file BASS/VB/Bass.bas <-- visual basic wrapper for BASS.dll
2. See the function declaration
Code: (glbasic) [Select]
Declare Function BASS_Init Lib "bass.dll" (ByVal device As Long, ByVal freq As Long, ByVal flags As Long, ByVal win As Long, ByVal clsid As Long) As Long

3. Start a new gbas file (the wrapper)
4. Type:
Code: (glbasic) [Select]
INLINE
DECLARE_C(BASS_Init, "bass.dll", (long device, long freq, long flags, long win, long clsid), long)

ENDINLINE

FUNCTION GLB_BASS_Init%: device%, freq%, flags%, win%, clsid%
INLINE
return BASS_Init(device, freq, flags, win, clsid);
ENDINLINE
ENDFUNCTION


That's the wrapping of one function. It would be cool to extend IMPORT so it can make use of DLLs...
But for now, you have to do it manually as said.

If the visualBasic wrapper says "ByVal", the value is passes as in GLBasic.