Re: Allegro 5 Wrapper Error

new topic     » goto parent     » topic index » view thread      » older message » newer message
Lone_EverGreen_Ranger said...

Hello,

I am having a issue when trying to wrap Allegro 5. I have most of the library wrapped, but when I try to use it an example, I get this a machine-level exception occured during execution of this statement. Here's the code below

Wrapper code

 
include std/machine.e 
include std/dll.e 
 
atom allg 
 
allg = open_dll("allegro-5.0.9-monolith-mt-debug.dll") 
 
if allg = 0 then 
   puts(1,"Could not open DLL!\n") 
end if 
 
public constant xal_create_display = define_c_func(allg,"al_create_display",{C_INT,C_INT},C_POINTER) 
 
public function al_create_display(atom w,atom h) 
	 
	return c_func(xal_create_display,{w,h}) 
	 
end function 
 

Test Program

 
include std/machine.e 
include euall5.ew 
 
atom ret = al_install_system(ALLEGRO_VERSION_INT,0) 
 
atom dis = al_create_display(640,480) --error comes from this 
 

I can post more code if it is needed.

What's the wrapper code for al_install_system() look like? Also, how are you defining ALLEGRO_VERSION_INT?

I'm wondering if the reason for the machine exception is because al_install_system() is returning false, but then the code calls al_create_display() anyways.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu