Euphoria questions and some help
- Posted by Talvitie <smtoa at SAUNALAHTI.FI> Sep 13, 1999
- 502 views
If I do some big mistake(like put_pixel({x,y,{col1,col2,...}}) ie. = sequence instead of atom) when coding for exotica my computer does a = total halt. It just doesn't response into anything and screen comes = blank. Only HDD (hard disk being used) light is then blinking. This = happens also sometimes when playing games. Does anybody know how to fix this? I got Win98 OS and DirectX 6.1 (I quess) I'm a bit interested of doing .dll files. How do you do 'em? Where can I = find help on it? can the <Esc> key be changed to fuction some other way ie. does it = always have to abort the run? -- Must get return_ids for above 3 MainLoop functions. Get_MainLoop_Init_Id(routine_id("MainLoop_Init")) Get_MainLoop_Id(routine_id("MainLoop")) Get_MainLoop_Exit_Id(routine_id("MainLoop_Exit")) Why these three loops have to be in program? I don't know you, but I get = this ugly feeling of them(I usually like to write the main program just = the way I want...no offence) Anyway. I quess that removing those loops as not being necessary for = program would require a lot of work, and propably you wouldn't even want = to do it, so what are the functions that may be used in each loop? f.ex. = put_pixel didn't wok in MainLoop_Init Todd wrote: >I've included some routines in the lastest Exotica( SURFACE_PITCH, >SURFACE_POINTER and BPP) which should help in mem_copy a screen >buffer to a DirectX surface. This is where I need help with. >If you or somebody else can provide me a very basic example >on how Euphoria can mem_copy a bitmap to the screen(Dos example is >what I'm expecting here) then I can continue testing out the new >routines and see if I can get it to work. Well, I'm not expert on these, but I checked how Pete does it in Neil. Here's a simple example of it:=20 --expected to use 32bit linear mode (has 24bit color depth, but can be = written usign the fast poke4 ;) --The color encoding is #RRGGBB RedGreenBlue, in <data> --The color encoding is #RRGGBBXX RedGreenBlue(X=3Dnot used), for each = pixel in video memory global procedure pixel(sequence data, integer x,integer y) atom offset,video_mem offset =3D video_mem + y* bytes_per_line + x * bytes_per_pixel poke4(offset, data) -- where <data> is sequence and contains the pixels (from left to right = on screen) which Neil is going to draw. --<offset> is atom that hold the address where Neil draws. --<x> and <y> are ofcouse the position where the drawing starts --<video_mem> is the place in memory where the first (0,0) pixel in the = left upper corner is drawn. --<bytes_per_line> =3D bytes_per_pixel * ScreenMaxX -- --If you want to copy a picture like this one stored into sequence to = screen, Neil does it this way: global procedure display_image(sequence pos, integer x,integer y) --> display a 2-d sequence on the screen (pos[3] may =3D virtual_screen) --> pixel image is in #RRGGBB hex format: #FF0000=3DRED #00FF00=3DGREEN = #0000FF=3DBLUE --> *** no clipping is performed due to speed constraints *** for y =3D 1 to length(image) do pixel(image[y], x,y) pos[2] =3D pos[2] + 1 end for end procedure Hope this helps ay :) if not, I'm sure that attleast Pete is more than = able to help you! --Tapani