1. Euphoria questions and some help

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

new topic     » topic index » view message » categorize

2. Re: Euphoria questions and some help

-----Original Message-----
From: Talvitie <smtoa at SAUNALAHTI.FI>
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.

Sounds like you have the expired direct x 6.1 instead of the full version.
MS built in an expire on this one, and the warning window pops up behind the
black screen...then you are looking at a black screen and going what is
this.  When you hit a key, it toggles the ok box in the waning and the
program continues.  All the warning says is your beta direct x 6 has
expired.  You have to download the full version from MS or find a copys
somewhere.  Many of the versions available from game demo disk magazines are
the beta version, or were for a while.  I also found that the win98 version
was only available with the update feature of win98....  but after you do
the update it did store an archive on the hard disk.
Keep up the good work!
Monty in Oregon

new topic     » goto parent     » topic index » view message » categorize

3. Re: Euphoria questions and some help

Talvitie wrote:
>
> 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.

Thats normal when a routine has failed and a error check of that
routine is trying to display a message box to display your error.
Keep the "Enter" key pressed and you should see stuff slowly being
displayed. Keep the "Esc" pressed down until it exits the program
back to windows. I'm starting to find this annoying myself. So I will
try to find a better solution for this problem of displaying what
error occured in a messagebox for the next release of Exotica. For
now, if you find this annoying too, you can use the FILE_REPORT
routine to print whatever error has occured inside of your error
check of the failed routine and have the program immediately do
a ' return 1 ' to exit the program. Then all ya got to do is look
into the generated E_Report.txt and see what eror occured. If you
use the FILE_REPORT routine to print stuff in the text file, make sure
you turn on the report mode with the ' c_proc(REPORT_MODE,{1}) '
routine before you call the DDRAW_INIT routine.


> Does anybody know how to fix this?
> I got Win98 OS and DirectX 6.1 (I quess)

I'm pretty sure you have DirectX 6.0+, if you got as far of seeing
a black screen. You will need DirectX 6.1 whenever I get DirectMusic
done and for DirectPlay whenever I get that done.

> I'm a bit interested of doing .dll files. How do you do 'em? Where can I find
> help on it?

I use MS Visual C++ 6.0 to generate my Dlls. MSVC comes with an
extra cd called the msdn Library cd filled with code samples,
documentation, and more. I learned how to do Dlls from that cd
alone and basically everything else windows related that I know
so far.

> can the <Esc> key be changed to fuction some other way ie. does it always have
> to abort the run?

Yes, you can change the Esc key to whatever you want or even take
it out if you want too and have some other way of exiting your program.
The 'emain.exw' file is where you will find this. The code is located in
the global function 'WndProc()'. The 'emain.exw' file is provided as an
example also. You can change emain.exw up anyway you want to.

> -- 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)

No offence taken :)
They are there because the 'emain.exw' file needs them to execute your
program. If you want to take them out, then you need to have the
'emain.exw' file and your file all in one big euphoria file. :)

> 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

Yes, it will require more work by doing like I mentioned above if you
want to make only one file. I will try to help you achieve this if
you need help. In order for the put_pixel to work properly, it's needs
the DDRAW_INIT routine called in a intialization area of a program
and then in your main loop, it needs to have the SURFACE_LOCK routine
called before any put_pixel routines are called. Then after you
finished drawing with put_pixel, you then need to call the
SURFACE_UNLOCK
routine. I just realized I didn't include an example to demostrate
this in Exotica. I apologize for that. I will try to post an example
here tonight demostrating this.

> Well, I'm not expert on these, but I checked how Pete does it in Neil.
> Here's a simple example of it:

Thanks for the example code. :) I will try to make it work with it.

- Todd Riggins

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu