Re: Euphoria questions and some help
- Posted by Todd Riggins <triggins at AIRMAIL.NET> Sep 13, 1999
- 460 views
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