Re: Attempting to subscript an atom Error[SOLVED]

new topic     » goto parent     » topic index » view thread      » older message » newer message
petelomax said...
Icy_Viking said...
xal_get_allegro_primitives_version = define_c_func(prim,"al_get_allegro_primitives_version",{},C_UINT) 
         xal_init_primitives_addon = define_c_func(prim,"+al_init_primitives_addon",{},C_BOOL), 

Could it be that you don't want the + at all, or (less likely) the first is missing a +?
Also, have you checked that none of the xal_init_primitives_addon etc are getting set to -1?
And open_dll() isn't returning null - in my experience Windows is a bit fussy about not having ".dll" at the end of the name, but that might be a Phix thing.

Thank you Pete. I forgot to add .dll when loading the library and the first function was missing the "+". The primitive demo now works.

--Simple Display Window demo 
--Draw primitive shapes 
 
include allegro.e 
include keycodes.e 
include std/ffi.e 
 
include primitives.e 
 
procedure main() 
 
 atom x = al_install_system(ALLEGRO_VERSION_INT,0) 
  
 atom a = al_init_primitives_addon() 
  
 if x = -1 then 
 	puts(1,"Failed to init Allegro!\n") 
 	abort(0) 
 end if 
  
 if a = -1 then 
 	puts(1,"Failed to init addon!\n") 
 	abort(0) 
 end if 
  
 atom dis = al_create_display(800,600) 
  
 if dis = -1 then 
 	puts(1,"Failed to create display!\n") 
 	abort(0) 
 end if 
  
 al_set_window_title(dis,"Primitive Demo") 
  
 sequence BLUE = al_map_rgb(0,0,255) 
 
 al_draw_line(800 / 2,0,800,600,BLUE,0)  
 
 al_flip_display() 
   
 al_rest(5.0) 
  
 al_destroy_display(dis) 
	 
end procedure 
 
main() 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu