Dark Bit Factory & Gravity
PROGRAMMING => C / C++ /C# => Topic started by: ChipWarrior on February 04, 2010
-
Hi There!
I searched my ass of for a Tutorial on bassmod on Visual C++ but i cant get it 2 work :(
So ich found this Forum and see some Interest stuff around here and just reg me bc0z i wanna learn more about Demoscene...
So i thougt i start with the Basics: C++ with Classes and Co ist no big deal but i am Wondering wit that bassmod DLL... i cant get it to work, i just wanna Play an .XM File inmy Application like a Keygen.
I tried PlaySounds() but this doesent Work either and when will call InitAndPlay() for Bassmod it just says unknown Variable... :-/
So anyone wanna help me to get some qewl Chiptunes in my Application?
-
Hi ChipWarrior, welcome to the forum!
Quick question - have you done much Visual Studio programming or C or C++ programming before?
Under the project properties, linker, additional dependencies setting you need to add 'bassmod.lib' - simplest thing to do is to copy this .lib file from the bassmod20\c file into your project folder.
You also need to #include "bassmod.h" from that folder into your project, though I guess you've probably done that.
If you can't get that to work, I'm sure one of our members will be along in a sec with a quick sample code.
Have you got a demo in the works, or is this something for yourself?
Cheers,
Jim
-
Hey THX for the warm Welcome!
Yes i Code sinde 1,5 Years in C++ most in Console Application but since a half Year in GUI Applications...
I read about the bassmod.lib and how to import a DLL and i "think" i got it straight but i am not very sure, bc0z its the First time i do so... At least the Code Compiles with no Error...
Its not really a Demo now just a Tool with some Keygen-Flavor but i wanna Develop for the Demoscene in the Feature, i am since 3 Years huge Fan of the Scene, and will particpate in the Future, but as i say i am a total n00b in GUI Coding but MS VC++ takes a lot Work from me...
So another Question:
For Demos it is better to Code managed C++ or Win32 WINAPI?
-
:hi:
Have you got it to play music dude?
If you want a hand I'll have a look into it for you.
-
For Demos it is better to Code managed C++ or Win32 WINAPI?
I'd avoid managed stuff for demos, but it can be done. I've got a prototype c# 3d software render which runs not too bad (well, it runs slow, but it's interesting :)).
Jim
-
:hi:
Have you got it to play music dude?
If you want a hand I'll have a look into it for you.
thx man i will come back for that another time ;D really great forum here thanks for all you help meights without you i wouldent have make it!
so i finally got it r1ght, the problem was that i got in trouble with this peace of code:
BASSMOD_Init(-1, 44100, 0); //device, bitrate, flag
BASSMOD_MusicLoad(false, "CORE.MOD", 0, 0, BASS_MUSIC_LOOP);
BASSMOD_MusicPlay();
i thougt i have to declare the funktions in the header like the codesnippets in de manual but i finaly understand this hole .dll thing xD
so then my compiler bug me out with:
fatal error LNK1313: ijw/native-Modul gefunden. Es kann kein Link mit pure-Modulen hergestellt werden.
//says: cannot link to pure-modules
and then i could make it run when i change my compiler settings from /clr:pure to /clr and my programm is finaly playing musik :clap:
so here is the code for an empty form in visual c++ for a clr projekt that plays a .mod file named core.mod
#include "stdafx.h"
#include "Form1.h"
#include "bassmod.h"
#pragma comment( lib, "bassmod.lib" )
using namespace projekt;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
if( BASSMOD_Init ( -1, 44100, 0 ) == false)
{
MessageBox::Show( "Coud not Init BASS" );
}
if(BASSMOD_MusicLoad ( FALSE, "core.mod", 0, 0, BASS_MUSIC_LOOP ) == false)
{
MessageBox::Show ( "Could not laod the Music File" );
}
if( BASSMOD_MusicPlay( ) == false)
{
MessageBox::Show ( "Can not Play the Music File" );
}
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Application::Run(gcnew Form1());
return 0;
}