home *** CD-ROM | disk | FTP | other *** search
/ ftp.xmission.com / 2014.06.ftp.xmission.com.tar / ftp.xmission.com / pub / lists / fractdev / archive / fractdev.200006 < prev    next >
Internet Message Format  |  2000-06-30  |  45KB

  1. From: "Scott D. Boyd" <sdboyd@fastlane.net>
  2. Subject: Bug fix in Xfractint 20.0.11
  3. Date: 02 Jun 2000 22:40:18 -0500
  4.  
  5. I have found the bug that kept '#' and 'F3' from selecting 3D Overlay while
  6. at the Main Menu in Xfractint. I removed lines 1294 - 1295 in unixscr.c.
  7.  
  8. This bug was present in both versions 20.0.7 and 20.0.11. '#' didn't work in
  9. either xterm or KDE's konsole, and F3 didn't work in KDE's konsole. Now I have
  10. '#' working from both xterm and konsole. 
  11.  
  12. This fix has been tested and known to work in Xfractint 20.0.11 running in
  13. xterm and KDE's konsole. (Well, that partly fixes the problem. At least the 
  14. key indicated in the Main Menu now works! So I guess you could call it a "quick
  15. fix".) 
  16.  
  17.  
  18. -- 
  19. email:  sdboyd@fastlane.net
  20. http://www.fastlane.net/~sdboyd/
  21. "Make it idiot-proof, and someone will make a better idiot."
  22.  
  23.  
  24. Thanks for using Fractdev, The Fractint Developer's Discussion List
  25. Post Message:   fractdev@lists.xmission.com
  26. Get Commands:   majordomo@lists.xmission.com "help"
  27. Administrator:  twegner@fractint.org
  28. Unsubscribe:    majordomo@lists.xmission.com "unsubscribe fractdev"
  29.  
  30.  
  31. -------------------------------------------------------------------------------
  32.  
  33. From: "Jonathan Osuch" <osuchj@uswest.net>
  34. Subject: Re: Bug fix in Xfractint 20.0.11
  35. Date: 04 Jun 2000 16:28:43 -0500
  36.  
  37. Scott,
  38.  
  39. > I have found the bug that kept '#' and 'F3' from selecting 3D Overlay
  40. while
  41. > at the Main Menu in Xfractint. I removed lines 1294 - 1295 in unixscr.c.
  42.  
  43. That is a routine I think I will change to be bypassed unless requested by a
  44. command line option.  It catches the control-e used by the evolver, also.
  45.  
  46. Jonathan
  47.  
  48.  
  49.  
  50. Thanks for using Fractdev, The Fractint Developer's Discussion List
  51. Post Message:   fractdev@lists.xmission.com
  52. Get Commands:   majordomo@lists.xmission.com "help"
  53. Administrator:  twegner@fractint.org
  54. Unsubscribe:    majordomo@lists.xmission.com "unsubscribe fractdev"
  55.  
  56.  
  57. -------------------------------------------------------------------------------
  58.  
  59. From: "Jonathan Osuch" <osuchj@uswest.net>
  60. Subject: Allegro port status
  61. Date: 27 Jun 2000 20:40:23 -0500
  62.  
  63. Tim,
  64.  
  65. The latest set of source code available to you has all the menus working.
  66. The temporary messages still need a little work.
  67.  
  68. We need to work on the interface we want to use for the various graphics
  69. modes.  Currently, the built in Allegro function is used to provide a menu,
  70. but we don't need (or want?) to use it.  We could set up the command line
  71. such that something like: video=1024x768x24  would provide the resolution
  72. and the color depth.  Backwards compatibility needs to be worked out also.
  73. As does the results of pressing the function keys and what appears when the
  74. delete key is pressed.  Also, we need to consider how setting the disk video
  75. resolution will work.  We could have a menu like:
  76.  
  77. X Width           1078
  78. Y Depth           768
  79. Color Depth     24
  80.  
  81. I have a version where the palette editor (with 8 bit color) works to a
  82. certain extent.  There are sections of code that will need to be changed to
  83. get the alignment of the boxes and characters correct.
  84.  
  85. There is also a problem with displaying arrows (for which keys to use) on
  86. the screen.  This is due to using the default key mapping from Allegro.  I
  87. haven't tried to fix it yet.
  88.  
  89. Jonathan
  90.  
  91.  
  92.  
  93. Thanks for using Fractdev, The Fractint Developer's Discussion List
  94. Post Message:   fractdev@lists.xmission.com
  95. Get Commands:   majordomo@lists.xmission.com "help"
  96. Administrator:  twegner@fractint.org
  97. Unsubscribe:    majordomo@lists.xmission.com "unsubscribe fractdev"
  98.  
  99.  
  100. -------------------------------------------------------------------------------
  101.  
  102. From: Phil McRevis <legalize@xmission.com>
  103. Subject: Re: Allegro port status 
  104. Date: 28 Jun 2000 13:48:33 -0600
  105.  
  106.  
  107. In article <000d01bfe0a1$e329ff00$0100a8c0@bananasenior>,
  108.     "Jonathan Osuch" <osuchj@uswest.net>  writes:
  109.  
  110. > but we don't need (or want?) to use it.  We could set up the command line
  111. > such that something like: video=1024x768x24  would provide the resolution
  112. > and the color depth.
  113.  
  114. Specifying the depth alone isn't enough to identify various video
  115. modes of importance.  For instance, in 16-bit mode you have RGB 5:6:5
  116. and xRGB 1:5:5:5 and RGBA 5:5:5:1.
  117.  
  118. > Backwards compatibility needs to be worked out also.
  119.  
  120. Fractint currently only remembers the video mode from the function key
  121. definition.  This should be changed to specify the video mode
  122. explicitly rather than relying on the indirection through the video
  123. key mapping.
  124.  
  125. > As does the results of pressing the function keys and what appears when the
  126. > delete key is pressed.  Also, we need to consider how setting the disk video
  127. > resolution will work.
  128.  
  129. I envisioned that "disk video" mode would be just another device
  130. selected through the interface.  It can have an arbitrary pixel format
  131. for its output, since its all in software.  The larger vision was to
  132. enable the possibility of having Win32 modes and DirectX modes living
  133. side-by-side even though they are pretty different on the insides.
  134.  
  135. That's why the menuing, etc., code has to be in the driver interface
  136. -- doing a menu under Win32 or DOS/Allegro is going to be very
  137. different from doing it under DirectX or the Mac, or Xlib, etc.
  138. --
  139. <http://www.xmission.com/~legalize/>    Legalize Adulthood!
  140.     ``Ain't it funny that they all fire the pistol,     
  141.       at the wrong end of the race?''--PDBT     
  142. legalize@xmission.com    <http://www.xmission.com/~legalize/who/>
  143.  
  144. Thanks for using Fractdev, The Fractint Developer's Discussion List
  145. Post Message:   fractdev@lists.xmission.com
  146. Get Commands:   majordomo@lists.xmission.com "help"
  147. Administrator:  twegner@fractint.org
  148. Unsubscribe:    majordomo@lists.xmission.com "unsubscribe fractdev"
  149.  
  150.  
  151. -------------------------------------------------------------------------------
  152.  
  153. From: "Jonathan Osuch" <osuchj@uswest.net>
  154. Subject: Re: Allegro port status 
  155. Date: 29 Jun 2000 16:26:01 -0500
  156.  
  157. Rich,
  158.  
  159. > Specifying the depth alone isn't enough to identify various video
  160. > modes of importance.  For instance, in 16-bit mode you have RGB 5:6:5
  161. > and xRGB 1:5:5:5 and RGBA 5:5:5:1.
  162.  
  163. We can certainly address this.  Since Allegro does this for us behind the
  164. scenes, your input will be invaluable in setting this up.  I take it you are
  165. suggesting something along the lines of: video=1024x768x5x6x5x0
  166.  
  167. Or, would it be cleaner to use a different command line, such as:
  168. video=1024x768 depth=5:6:5:0
  169.  
  170. > Fractint currently only remembers the video mode from the function key
  171. > definition.  This should be changed to specify the video mode
  172. > explicitly rather than relying on the indirection through the video
  173. > key mapping.
  174.  
  175. Yes, I agree.  But, in order to not break PAR's that use video=, we will
  176. still need to map those function keys to video modes.  OTOH, we could just
  177. ignore video= commands in PARs.  The problem that raises is that there are
  178. some images that are resolution dependent.
  179.  
  180. > I envisioned that "disk video" mode would be just another device
  181. > selected through the interface.  It can have an arbitrary pixel format
  182. > for its output, since its all in software.
  183.  
  184. Currently that is crudely done by recompiling.  I haven't taken a close look
  185. at how to switch from one device to another when both are memory resident.
  186.  
  187. It appears to me that the windows allowed by Allegro can also be arbitrarily
  188. sized.  Although you can run into a problem with the text being too small or
  189. off the edge of the window.
  190.  
  191. Jonathan
  192.  
  193. P.S.  If I don't respond to something you think is important it's probably
  194. because it went zinging over my head.  Please feel free to reiterate.
  195.  
  196.  
  197.  
  198. Thanks for using Fractdev, The Fractint Developer's Discussion List
  199. Post Message:   fractdev@lists.xmission.com
  200. Get Commands:   majordomo@lists.xmission.com "help"
  201. Administrator:  twegner@fractint.org
  202. Unsubscribe:    majordomo@lists.xmission.com "unsubscribe fractdev"
  203.  
  204.  
  205. -------------------------------------------------------------------------------
  206.  
  207. From: Phil McRevis <legalize@xmission.com>
  208. Subject: Re: Allegro port status 
  209. Date: 29 Jun 2000 17:54:22 -0600
  210.  
  211.  
  212. In article <000901bfe210$aaca4500$0100a8c0@bananasenior>,
  213.     "Jonathan Osuch" <osuchj@uswest.net>  writes:
  214.  
  215. > We can certainly address this.  Since Allegro does this for us behind the
  216. > scenes, your input will be invaluable in setting this up.  I take it you are
  217. > suggesting something along the lines of: video=1024x768x5x6x5x0
  218. > Or, would it be cleaner to use a different command line, such as:
  219. > video=1024x768 depth=5:6:5:0
  220.  
  221. I hadn't thought much about this recently.  On 29-Apr-1999, I wrote
  222. the following (which can be had from the archives at
  223. <ftp://ftp.xmission.com/pub/lists/fractdev/archive/>:
  224.  
  225. =====
  226.     Date: Thu, 29 Apr 1999 19:55:01 -0600
  227.       To: fractdev@lists.xmission.com
  228.     From: Phil McRevis <legalize@xmission.xmission.com>
  229. Reply-To: legalize@xmission.com
  230.    Organ: multi-cellular, biological
  231.  Subject: driver characteristics
  232. ---------
  233. Since Humberto brought up some specifics of drivers, I'll say a little
  234. about how I'm implementing the driver harness.  Naturally we'll be
  235. able to change the harness later.  The point is not to design some
  236. end-all be-all graphics API.  The idea is just to get things going
  237. incrementally.  Feel free to kibitz, if its a big issue, something can
  238. be done now, but please consider this more of a 'status report' for
  239. your information on what I'm doing, more than a design review where
  240. I'm proposing the idea. :-)
  241.  
  242. Existing video mode glue logic in fractint is currently implemented in
  243. select_video_mode().  It walks through the table stored in memory and
  244. creates the scrollable display of available video modes.  When you
  245. select a mode from the list (or by some other means like video=), then
  246. the proper parameters are snatched out of the table and sent to the
  247. assembly routine setvideomode (video.asm), which issues the
  248. appropriate commands to the video card.
  249.  
  250. With the harness, select_video_mode() instead walks a list of drivers
  251. and queries each driver about the modes supported by the driver.  It
  252. then displays a scrolling list created from the driver responses.
  253. When the user selects an item on the list, select_video_mode() calls
  254. through the driver harness to set the video mode.
  255.  
  256. This means that when we get to the point of having all (or several) or
  257. the drivers I list below, under win98 you could have the choice of
  258. the same video modes supported by multiple drivers.  The video display
  259. list might look like this:
  260.  
  261. key...driver...name.................xdot.ydot.color.comment.............
  262. SF1   win32    GDI Surface          1024x768  5:6:5
  263. SF2   directx  Windowed             1024x768  5:6:5
  264. SF3   directx  Full Screen          1024x768  8     256 colors
  265. SF4   directx  Full Screen          1024x768  5:6:5 16-bit RGB
  266. SF5   directx  Full Screen          1024x768  5:5:5 15-bit RGB
  267. SF6   opengl   Full Screen          1024x768  8     256 color indexed
  268. SF7   opengl   Full Screen          1024x768  8:8:8 24-bit RGB
  269.  
  270. (This is an ASCII graphic mockup; not a screen dump.)
  271.  
  272. Xdot and ydot take on a subtle meaning in a windowed environment, but
  273. window systemless drivers still need to be able to report device
  274. dimensions.
  275.  
  276. The video parameter ('video=<key>') currently only specifies a function
  277. key which is bound to a video mode.  It doesn't force a particular
  278. video mode, just selects one from the key list.  If you want to write a
  279. script or parameter file that uses a particular video mode, you have to
  280. ensure the proper key assignment is setup first.  To set the function
  281. key assignment you have to get into the fractint.cfg file.  Icky!
  282.  
  283. With the harness, the video parameter is updated to specify both the
  284. driver and the desires video mode provided by the driver.  So you'd
  285. say something like "video=directx/1024x768/8".  A new method for
  286. binding the keys to video modes will have to be provided, as the old
  287. method depended on fractint.cfg which is now specific to the fractint
  288. driver.
  289.  
  290. But what about the stuff the fractint.cfg file did?  That's used by the
  291. "fractint" driver (see blow) as input to decide what video modes it
  292. lists when queried.
  293.  
  294. Some really random ideas:
  295.  
  296. should image and model formats (3D raytracing files, etc) be
  297.     supported as compile-time modules like drivers?
  298.  
  299. should drivers be allowed to invoke the engine distinct from
  300.     fractint's gui?  Is the engine a client of the driver, or is the
  301.     driver a client of the engine?  Fractint is currently architected
  302.     towards the latter.  Reversing the assumption would be difficult.
  303.  
  304. should 3D drivers subsume 2D functionality?
  305.     Is there any reason you'd want to use ogl for 3D, but x11 for 2D?
  306.     If not, then "x11" and "opengl" drivers will provide everything
  307.     you need.  Select an "x11' driver video mode for 2D stuff and an
  308.     "opengl" driver video mode for 3D stuff.  Fractint doesn't (yet)
  309.     mix 2D and 3D rendering together.
  310.  
  311. Drivers
  312. -------
  313. display drivers I think should be done, in no particular order:
  314.     "curses"
  315.     possibly uses curses, but only has character I/O.
  316.     Displays "pixels" using characters as similar to XaoS.
  317.     Enumerate text vide modes (DOS) or screen sizes (curses?) to
  318.         form "video modes" table.
  319.     Works in DOS (pd curses) and unix (native curses).
  320.  
  321.     "fractint"
  322.     port existing fractint assembly code to 32-bit flat model.
  323.     Included is the native video and mouse support coded in
  324.     assembly.
  325.  
  326.     "allegro"
  327.     Uses Allegro library under DJGPP to enumerate video formats
  328.     and provide video/mouse/sound support.
  329.  
  330.     "disk"
  331.     Video modes contain list of standard image sizes and "custom",
  332.     letting you set the size.
  333.  
  334.     "win32"
  335.     text menus are displayed graphically somehow.
  336.     graphics display native to GDI presented as video mode.
  337.     Emulate other modes?  Only if someone desperate for it --
  338.     directx would be the preferred solution!
  339.  
  340.     "directx"
  341.     text menus are displayed using a regular win32 window on GDI
  342.         surface, or as graphic text on graphics screen (driver
  343.         option).
  344.     graphics display is done through full-screen with DirectDraw.
  345.     DirectDrawDevices enumerated by DDraw are the video modes.
  346.  
  347.     "direct3d"
  348.     Same as directx, but uses D3D for 3D effects.
  349.  
  350.     "x11"
  351.     Text menus are displayed graphically using X11.
  352.     Available visuals on the screen are the video modes.
  353.     
  354.     "opengl"
  355.     Same as X11, only OGL-capable visuals are video modes.
  356.     Uses OGL for all pixel I/O and 3D.
  357.  
  358. like XaoS, more that one driver can be available, but only one driver
  359. can be active at once in any given graphic window.
  360. =====
  361.  
  362. So I think I was expecting that the old video mode specifications
  363. would still be supported (they wouldn't contain /'s) and that the new
  364. video specification would be a driver/resolution/depth argument, where
  365. the depth would be stated to be sufficiently unique.  I think I prefer
  366. R:G:B:A, with the letters replaced by the number of bits dedicated to
  367. each color channel.  This disambiguates 5:5:5, 5:6:5, and 5:5:5:1
  368. pixel formats for 16-bit depth, i.e. "video=allegro/1024x768/5:5:5".
  369.  
  370. > Yes, I agree.  But, in order to not break PAR's that use video=, we will
  371. > still need to map those function keys to video modes.  OTOH, we could just
  372. > ignore video= commands in PARs.  The problem that raises is that there are
  373. > some images that are resolution dependent.
  374.  
  375. For the "video=SF5" case, we handle the existing mapping of function
  376. keys to video modes but only via the default key mapping.  I never
  377. liked the idea that someone else could customize their key mapping and
  378. I'd get a different resolution image because I didn't have their map
  379. of keys to video modes.  So just support the default key mapping for
  380. backwards compatability and don't read the mapping file (or ignore the
  381. mapping section of the fractint.cfg or wherever its stored, I forget).
  382. This will give people who customized the mapping file an incentive to
  383. use the new video format specification that isn't dependent on their
  384. key mappings.
  385.  
  386. > Currently that is crudely done by recompiling.  I haven't taken a close look
  387. > at how to switch from one device to another when both are memory resident.
  388.  
  389. I imagined that the total number of drivers available is decided at
  390. compile time.  Since I started by working on the X11 driver, I didn't
  391. get to the point where switching between drivers was something that I
  392. tried.  However, I think the driver structure that I put together can
  393. handle this.  In the code I wrote, you can see where I do a 'trick' of
  394. having the first N bytes of the driver structures identical across all
  395. drivers and drivers tack on their own private data at the end of this
  396. structure.  This lets all code outside the driver treat the all
  397. drivers the same, but inside each driver, a cast is used to make the
  398. driver private data visible inside the driver-related code.
  399.  
  400. For X11 this is where things like the Display * pointer, and so-on get
  401. stored.  I imagine that Allegro also has a few little bits of
  402. configuration data that the driver needs -- opaque handles to
  403. resources or whatnot.  The Allegro driver should follow a similar
  404. pattern to the X11 code in how it stores this data.
  405.  
  406. To switch from one driver to another dynamically, you ask the existing
  407. driver to shut itself down and clean up its private data.  (A
  408. full-screen DirectX driver here would release the exclusive access to
  409. the full-screen here, for instance.)  Then you ask the new driver to
  410. initialize itself and allocate its private data.  The you set the
  411. "current driver pointer" to point to the new driver's data block.
  412.  
  413. A driver can implement its driver+private data structure as a
  414. statically allocated file-scope struct, provided it is careful about
  415. how it uses the data block.  A driver could also implement things by
  416. dynamically allocating the structure.  Everyone outside the driver
  417. doesn't care because everything happens through a pointer no matter
  418. how the block of data was allocated.
  419.  
  420.  
  421. > It appears to me that the windows allowed by Allegro can also be arbitrarily
  422. > sized.  Although you can run into a problem with the text being too small or
  423. > off the edge of the window.
  424.  
  425. This could be useful.  I was wondering how to draw legible text in a
  426. tiny video mode like 320x200.  Fractint deals with it by having a
  427. hand-coded "font" bitmap that it copies into video memory, but when
  428. you move to a framework, you have to wonder how the framework will
  429. deal with these kinds of things.  Frankly I'm not too worried about
  430. 320x200 looking crappy :-)
  431.  
  432. > P.S.  If I don't respond to something you think is important it's probably
  433. > because it went zinging over my head.  Please feel free to reiterate.
  434.  
  435. OK, well its probably best for you to ask me to repeat things you
  436. don't understand, if any.  Otherwise if you don't comment on it I'll
  437. assume you understood it all :-).  I don't mind re-explaining
  438. something different or in more detail so don't be shy about asking.
  439. --
  440. <http://www.xmission.com/~legalize/>    Legalize Adulthood!
  441.     ``Ain't it funny that they all fire the pistol,     
  442.       at the wrong end of the race?''--PDBT     
  443. legalize@xmission.com    <http://www.xmission.com/~legalize/who/>
  444.  
  445. Thanks for using Fractdev, The Fractint Developer's Discussion List
  446. Post Message:   fractdev@lists.xmission.com
  447. Get Commands:   majordomo@lists.xmission.com "help"
  448. Administrator:  twegner@fractint.org
  449. Unsubscribe:    majordomo@lists.xmission.com "unsubscribe fractdev"
  450.  
  451.  
  452. -------------------------------------------------------------------------------
  453.  
  454. From: Phil McRevis <legalize@xmission.com>
  455. Subject: Re: Allegro port status 
  456. Date: 29 Jun 2000 17:54:22 -0600
  457.  
  458.  
  459. In article <000901bfe210$aaca4500$0100a8c0@bananasenior>,
  460.     "Jonathan Osuch" <osuchj@uswest.net>  writes:
  461.  
  462. > We can certainly address this.  Since Allegro does this for us behind the
  463. > scenes, your input will be invaluable in setting this up.  I take it you are
  464. > suggesting something along the lines of: video=1024x768x5x6x5x0
  465. > Or, would it be cleaner to use a different command line, such as:
  466. > video=1024x768 depth=5:6:5:0
  467.  
  468. I hadn't thought much about this recently.  On 29-Apr-1999, I wrote
  469. the following (which can be had from the archives at
  470. <ftp://ftp.xmission.com/pub/lists/fractdev/archive/>:
  471.  
  472. =====
  473.     Date: Thu, 29 Apr 1999 19:55:01 -0600
  474.       To: fractdev@lists.xmission.com
  475.     From: Phil McRevis <legalize@xmission.xmission.com>
  476. Reply-To: legalize@xmission.com
  477.    Organ: multi-cellular, biological
  478.  Subject: driver characteristics
  479. ---------
  480. Since Humberto brought up some specifics of drivers, I'll say a little
  481. about how I'm implementing the driver harness.  Naturally we'll be
  482. able to change the harness later.  The point is not to design some
  483. end-all be-all graphics API.  The idea is just to get things going
  484. incrementally.  Feel free to kibitz, if its a big issue, something can
  485. be done now, but please consider this more of a 'status report' for
  486. your information on what I'm doing, more than a design review where
  487. I'm proposing the idea. :-)
  488.  
  489. Existing video mode glue logic in fractint is currently implemented in
  490. select_video_mode().  It walks through the table stored in memory and
  491. creates the scrollable display of available video modes.  When you
  492. select a mode from the list (or by some other means like video=), then
  493. the proper parameters are snatched out of the table and sent to the
  494. assembly routine setvideomode (video.asm), which issues the
  495. appropriate commands to the video card.
  496.  
  497. With the harness, select_video_mode() instead walks a list of drivers
  498. and queries each driver about the modes supported by the driver.  It
  499. then displays a scrolling list created from the driver responses.
  500. When the user selects an item on the list, select_video_mode() calls
  501. through the driver harness to set the video mode.
  502.  
  503. This means that when we get to the point of having all (or several) or
  504. the drivers I list below, under win98 you could have the choice of
  505. the same video modes supported by multiple drivers.  The video display
  506. list might look like this:
  507.  
  508. key...driver...name.................xdot.ydot.color.comment.............
  509. SF1   win32    GDI Surface          1024x768  5:6:5
  510. SF2   directx  Windowed             1024x768  5:6:5
  511. SF3   directx  Full Screen          1024x768  8     256 colors
  512. SF4   directx  Full Screen          1024x768  5:6:5 16-bit RGB
  513. SF5   directx  Full Screen          1024x768  5:5:5 15-bit RGB
  514. SF6   opengl   Full Screen          1024x768  8     256 color indexed
  515. SF7   opengl   Full Screen          1024x768  8:8:8 24-bit RGB
  516.  
  517. (This is an ASCII graphic mockup; not a screen dump.)
  518.  
  519. Xdot and ydot take on a subtle meaning in a windowed environment, but
  520. window systemless drivers still need to be able to report device
  521. dimensions.
  522.  
  523. The video parameter ('video=<key>') currently only specifies a function
  524. key which is bound to a video mode.  It doesn't force a particular
  525. video mode, just selects one from the key list.  If you want to write a
  526. script or parameter file that uses a particular video mode, you have to
  527. ensure the proper key assignment is setup first.  To set the function
  528. key assignment you have to get into the fractint.cfg file.  Icky!
  529.  
  530. With the harness, the video parameter is updated to specify both the
  531. driver and the desires video mode provided by the driver.  So you'd
  532. say something like "video=directx/1024x768/8".  A new method for
  533. binding the keys to video modes will have to be provided, as the old
  534. method depended on fractint.cfg which is now specific to the fractint
  535. driver.
  536.  
  537. But what about the stuff the fractint.cfg file did?  That's used by the
  538. "fractint" driver (see blow) as input to decide what video modes it
  539. lists when queried.
  540.  
  541. Some really random ideas:
  542.  
  543. should image and model formats (3D raytracing files, etc) be
  544.     supported as compile-time modules like drivers?
  545.  
  546. should drivers be allowed to invoke the engine distinct from
  547.     fractint's gui?  Is the engine a client of the driver, or is the
  548.     driver a client of the engine?  Fractint is currently architected
  549.     towards the latter.  Reversing the assumption would be difficult.
  550.  
  551. should 3D drivers subsume 2D functionality?
  552.     Is there any reason you'd want to use ogl for 3D, but x11 for 2D?
  553.     If not, then "x11" and "opengl" drivers will provide everything
  554.     you need.  Select an "x11' driver video mode for 2D stuff and an
  555.     "opengl" driver video mode for 3D stuff.  Fractint doesn't (yet)
  556.     mix 2D and 3D rendering together.
  557.  
  558. Drivers
  559. -------
  560. display drivers I think should be done, in no particular order:
  561.     "curses"
  562.     possibly uses curses, but only has character I/O.
  563.     Displays "pixels" using characters as similar to XaoS.
  564.     Enumerate text vide modes (DOS) or screen sizes (curses?) to
  565.         form "video modes" table.
  566.     Works in DOS (pd curses) and unix (native curses).
  567.  
  568.     "fractint"
  569.     port existing fractint assembly code to 32-bit flat model.
  570.     Included is the native video and mouse support coded in
  571.     assembly.
  572.  
  573.     "allegro"
  574.     Uses Allegro library under DJGPP to enumerate video formats
  575.     and provide video/mouse/sound support.
  576.  
  577.     "disk"
  578.     Video modes contain list of standard image sizes and "custom",
  579.     letting you set the size.
  580.  
  581.     "win32"
  582.     text menus are displayed graphically somehow.
  583.     graphics display native to GDI presented as video mode.
  584.     Emulate other modes?  Only if someone desperate for it --
  585.     directx would be the preferred solution!
  586.  
  587.     "directx"
  588.     text menus are displayed using a regular win32 window on GDI
  589.         surface, or as graphic text on graphics screen (driver
  590.         option).
  591.     graphics display is done through full-screen with DirectDraw.
  592.     DirectDrawDevices enumerated by DDraw are the video modes.
  593.  
  594.     "direct3d"
  595.     Same as directx, but uses D3D for 3D effects.
  596.  
  597.     "x11"
  598.     Text menus are displayed graphically using X11.
  599.     Available visuals on the screen are the video modes.
  600.     
  601.     "opengl"
  602.     Same as X11, only OGL-capable visuals are video modes.
  603.     Uses OGL for all pixel I/O and 3D.
  604.  
  605. like XaoS, more that one driver can be available, but only one driver
  606. can be active at once in any given graphic window.
  607. =====
  608.  
  609. So I think I was expecting that the old video mode specifications
  610. would still be supported (they wouldn't contain /'s) and that the new
  611. video specification would be a driver/resolution/depth argument, where
  612. the depth would be stated to be sufficiently unique.  I think I prefer
  613. R:G:B:A, with the letters replaced by the number of bits dedicated to
  614. each color channel.  This disambiguates 5:5:5, 5:6:5, and 5:5:5:1
  615. pixel formats for 16-bit depth, i.e. "video=allegro/1024x768/5:5:5".
  616.  
  617. > Yes, I agree.  But, in order to not break PAR's that use video=, we will
  618. > still need to map those function keys to video modes.  OTOH, we could just
  619. > ignore video= commands in PARs.  The problem that raises is that there are
  620. > some images that are resolution dependent.
  621.  
  622. For the "video=SF5" case, we handle the existing mapping of function
  623. keys to video modes but only via the default key mapping.  I never
  624. liked the idea that someone else could customize their key mapping and
  625. I'd get a different resolution image because I didn't have their map
  626. of keys to video modes.  So just support the default key mapping for
  627. backwards compatability and don't read the mapping file (or ignore the
  628. mapping section of the fractint.cfg or wherever its stored, I forget).
  629. This will give people who customized the mapping file an incentive to
  630. use the new video format specification that isn't dependent on their
  631. key mappings.
  632.  
  633. > Currently that is crudely done by recompiling.  I haven't taken a close look
  634. > at how to switch from one device to another when both are memory resident.
  635.  
  636. I imagined that the total number of drivers available is decided at
  637. compile time.  Since I started by working on the X11 driver, I didn't
  638. get to the point where switching between drivers was something that I
  639. tried.  However, I think the driver structure that I put together can
  640. handle this.  In the code I wrote, you can see where I do a 'trick' of
  641. having the first N bytes of the driver structures identical across all
  642. drivers and drivers tack on their own private data at the end of this
  643. structure.  This lets all code outside the driver treat the all
  644. drivers the same, but inside each driver, a cast is used to make the
  645. driver private data visible inside the driver-related code.
  646.  
  647. For X11 this is where things like the Display * pointer, and so-on get
  648. stored.  I imagine that Allegro also has a few little bits of
  649. configuration data that the driver needs -- opaque handles to
  650. resources or whatnot.  The Allegro driver should follow a similar
  651. pattern to the X11 code in how it stores this data.
  652.  
  653. To switch from one driver to another dynamically, you ask the existing
  654. driver to shut itself down and clean up its private data.  (A
  655. full-screen DirectX driver here would release the exclusive access to
  656. the full-screen here, for instance.)  Then you ask the new driver to
  657. initialize itself and allocate its private data.  The you set the
  658. "current driver pointer" to point to the new driver's data block.
  659.  
  660. A driver can implement its driver+private data structure as a
  661. statically allocated file-scope struct, provided it is careful about
  662. how it uses the data block.  A driver could also implement things by
  663. dynamically allocating the structure.  Everyone outside the driver
  664. doesn't care because everything happens through a pointer no matter
  665. how the block of data was allocated.
  666.  
  667.  
  668. > It appears to me that the windows allowed by Allegro can also be arbitrarily
  669. > sized.  Although you can run into a problem with the text being too small or
  670. > off the edge of the window.
  671.  
  672. This could be useful.  I was wondering how to draw legible text in a
  673. tiny video mode like 320x200.  Fractint deals with it by having a
  674. hand-coded "font" bitmap that it copies into video memory, but when
  675. you move to a framework, you have to wonder how the framework will
  676. deal with these kinds of things.  Frankly I'm not too worried about
  677. 320x200 looking crappy :-)
  678.  
  679. > P.S.  If I don't respond to something you think is important it's probably
  680. > because it went zinging over my head.  Please feel free to reiterate.
  681.  
  682. OK, well its probably best for you to ask me to repeat things you
  683. don't understand, if any.  Otherwise if you don't comment on it I'll
  684. assume you understood it all :-).  I don't mind re-explaining
  685. something different or in more detail so don't be shy about asking.
  686. --
  687. <http://www.xmission.com/~legalize/>    Legalize Adulthood!
  688.     ``Ain't it funny that they all fire the pistol,     
  689.       at the wrong end of the race?''--PDBT     
  690. legalize@xmission.com    <http://www.xmission.com/~legalize/who/>
  691.  
  692. Thanks for using Fractdev, The Fractint Developer's Discussion List
  693. Post Message:   fractdev@lists.xmission.com
  694. Get Commands:   majordomo@lists.xmission.com "help"
  695. Administrator:  twegner@fractint.org
  696. Unsubscribe:    majordomo@lists.xmission.com "unsubscribe fractdev"
  697.  
  698.  
  699. -------------------------------------------------------------------------------
  700.  
  701. From: "Jonathan Osuch" <osuchj@uswest.net>
  702. Subject: Re: Allegro port status 
  703. Date: 29 Jun 2000 20:37:31 -0500
  704.  
  705. Rich,
  706.  
  707. > The Allegro driver should follow a similar
  708. > pattern to the X11 code in how it stores this data.
  709.  
  710. Yes, it does.  I started by copying your X11 file and then changed things
  711. over to Allegro specific.  I still need to clean up the extra variables.  I
  712. believe, in my version, the disk video and X11 drivers are broken.  I'll fix
  713. them.
  714.  
  715. Now I see how we will switch between drivers.  However, what do we do on
  716. initial startup, ie. no video= statement in sstools.ini?  The program flow
  717. has been slightly altered in Xfractint because a video mode has to be
  718. selected (window opened) before text can be displayed.  We need to use a
  719. default driver to display the initial selection of drivers.  The disk video
  720. mode would be appropriate, but is it going to change from Allegro to W32,
  721. etc.?  Are we going to end up with multiple disk video drivers?
  722.  
  723. > OK, well its probably best for you to ask me to repeat things you
  724. > don't understand, if any.  Otherwise if you don't comment on it I'll
  725. > assume you understood it all :-).  I don't mind re-explaining
  726. > something different or in more detail so don't be shy about asking.
  727.  
  728. Okay, here goes.  Your description of how to implement an event-driven
  729. architecture has baffled me.  Not the basics, but how to use it in Fractint.
  730. What I would like to do, but don't know how, is to start up the event
  731. handler and then start the fractal engine and the plotting engine as
  732. children.  The data would be sent from the fractal engine to the plotting
  733. engine to be plotted on the screen.
  734.  
  735. Another thing that I'd like to know is the proper way to give time slices
  736. back to the operating system when the calculation is done.  This isn't from
  737. any of your comments, just something I'd like to know.
  738.  
  739. Jonathan
  740.  
  741.  
  742.  
  743. Thanks for using Fractdev, The Fractint Developer's Discussion List
  744. Post Message:   fractdev@lists.xmission.com
  745. Get Commands:   majordomo@lists.xmission.com "help"
  746. Administrator:  twegner@fractint.org
  747. Unsubscribe:    majordomo@lists.xmission.com "unsubscribe fractdev"
  748.  
  749.  
  750. -------------------------------------------------------------------------------
  751.  
  752. From: Phil McRevis <legalize@xmission.com>
  753. Subject: Re: Allegro port status 
  754. Date: 30 Jun 2000 20:12:37 -0600
  755.  
  756.  
  757. Did anyone else get two copies of my last message?  Sorry if I sent
  758. two by mistake, I seem to have received two.
  759.  
  760. In article <001b01bfe237$86805820$0100a8c0@bananasenior>,
  761.     "Jonathan Osuch" <osuchj@uswest.net>  writes:
  762.  
  763. > Now I see how we will switch between drivers.  However, what do we do on
  764. > initial startup, ie. no video= statement in sstools.ini?
  765.  
  766. My thoughts on this were: it depends on the platform.  Each "platform
  767. port" of fractint should select a lowest-common denominator video mode
  768. that is the most likely to be present or even better guaranteed to
  769. be present.  For X11 this means the default visual on the default
  770. display; for Win32 it means a Win32 GDI window on the desktop; I am
  771. not sure what Allegro would use for its default, but I'm betting that
  772. you do.
  773.  
  774. > [...] the initial selection of drivers.  The disk video
  775. > mode would be appropriate,
  776.  
  777. I was thinking that disk video mode would only be appropriate for the
  778. DOS code.  Here, "DOS" would be a platform distinct from Win32.  So
  779. the author of the "DOS" port would make the default driver the disk
  780. video mode driver.
  781.  
  782. > [The disk video mode] but is it going to change from Allegro to W32,
  783. > etc.?  Are we going to end up with multiple disk video drivers?
  784.  
  785. I think disk video mode should be platform and driver agnostic.  Disk
  786. video should be a portable software interface to a memory buffer as the
  787. video "device" and not depend on Win32 or any other driver or platform
  788. specific code.  The existing disk video mode code can be drawn into
  789. that driver.  (I think I did that for d_disk.c in the re-org of the
  790. code I put up).
  791.  
  792. That brings up the question of what a disk video mode uses for text I/O
  793. of menus and the like.  If you restrict yourself to the text I/O
  794. currently in fractint with its menu routines then everything will boil
  795. down to the few driver calls relating to text I/O.  From there the
  796. driver can take the text and display it using whatever method is
  797. appropriate for the platform.
  798.  
  799. I was thinking perhaps the most portable thing to do is to use curses.
  800. Curses libraries for MS-DOS exist and should be pretty well debugged at
  801. this point.  Curses is well supported for unix as well.  Is it on the
  802. mac?  Frankly, I can't see the point of making a curses-based disk
  803. video driver for the Mac; just use the Mac toolbox.  On the other
  804. hand, nothing fancier than a DMI DOS application that just used
  805. character I/O for status reporting could run on just about any old
  806. computer DOS-wise as a "dumb render farm".  It wouldn't even need
  807. VGA.
  808.  
  809. > Okay, here goes.  Your description of how to implement an event-driven
  810. > architecture has baffled me.  Not the basics, but how to use it in Fractint.
  811.  
  812. OK, I'm looking at ant.c right now.  I'll restructure ant.c according
  813. to the schema I advocated in an earlier message, that should make
  814. things concrete.  I'll post it in a separate message.
  815.  
  816. > What I would like to do, but don't know how, is to start up the event
  817. > handler and then start the fractal engine and the plotting engine as
  818. > children.
  819.  
  820. I see two choices here: threads or idle processing.
  821.  
  822. With threads, you can start a separate thread of control executing
  823. through the code which can simplify the implementation and readability
  824. of the code.  On Win32 and *nix both have threads, and so does the Mac
  825. I believe.  For threads, that leaves DOS as an unknown; I believe I've
  826. seen "thread" implementation libraries for DOS, but I've never
  827. investigated them in any great detail.  Perhaps someone else knows
  828. about thread support for DOS.  A Win32 console program can use threads,
  829. but that's not the same as a PMI DOS executable.
  830.  
  831. With idle processing, the program maintains a flag that it is doing
  832. background processing while also receiving input from the system.  In
  833. fractint currently, each local routine looking for input while doing
  834. processing has its own copy of the logic to look for input interspersed
  835. with doing bits of computation.  Each routine "polls" or checks the
  836. state of the input buffer for mouse and keyboard events while in the
  837. middle of a long processing loop.  (I think the mouse event code got
  838. hidden inside the keyboard checking code!)
  839.  
  840. Idle processing keeps everything going by checking for input while
  841. processing is occuring.  The processing continues so long as there is
  842. no input available.  When input does become available, the idle
  843. processing loop either stops (like when you press ESC) or switches to
  844. an input processing loop like that contained in the text menu code.
  845. Depending on the area of fractint, the idle processing may continue
  846. after the text menu returns control back to its caller.
  847.  
  848. > The data would be sent from the fractal engine to the plotting
  849. > engine to be plotted on the screen.
  850.  
  851. Or rather a pointer to the data, or an agreed upon global buffer.  No
  852. need to copy around lots of data :-).
  853.  
  854. > Another thing that I'd like to know is the proper way to give time slices
  855. > back to the operating system when the calculation is done.
  856.  
  857. With threads, the one or more computation threads go into a wait state,
  858. waiting to be woken up and signalled that there is more work to do
  859. (points to plot with the fractal function, pixels to draw).
  860.  
  861. With idle processing you simply toggle the flag that indicates work to
  862. be done during idle states when the program would otherwise be blocked
  863. waiting for a key press or mouse event.  Since there is no background
  864. work to be done, the idle processing variation can just issue the
  865. blocking I/O call since fractint's data processing is always driven by
  866. input, whether from the keyboard or a file.
  867.  
  868. --
  869. <http://www.xmission.com/~legalize/>    Legalize Adulthood!
  870.     ``Ain't it funny that they all fire the pistol,     
  871.       at the wrong end of the race?''--PDBT     
  872. legalize@xmission.com    <http://www.xmission.com/~legalize/who/>
  873.  
  874. Thanks for using Fractdev, The Fractint Developer's Discussion List
  875. Post Message:   fractdev@lists.xmission.com
  876. Get Commands:   majordomo@lists.xmission.com "help"
  877. Administrator:  twegner@fractint.org
  878. Unsubscribe:    majordomo@lists.xmission.com "unsubscribe fractdev"
  879.  
  880.  
  881. -------------------------------------------------------------------------------
  882.  
  883. From: Phil McRevis <legalize@xmission.com>
  884. Subject: ant.c example
  885. Date: 30 Jun 2000 21:12:07 -0600
  886.  
  887. Existing ant.c routine TurkMite1 which does ant simulation processing
  888. until ESC is pressed or the number of desired points are plotted.
  889. TurkMite1 is called by ant(), which is called by the main input
  890. processing loop in framain2.c. (look for case 1: /* ^a Ant */)
  891.  
  892. =====================================================================
  893.  
  894. void
  895. TurkMite1(int maxtur, int rule_len, char *ru, long maxpts, long wait)
  896. {
  897.    int color, ix, iy, idir, pixel, i;
  898.    int kbdchar, step, antwrap;
  899.    int x[MAX_ANTS + 1], y[MAX_ANTS + 1];
  900.    int next_col[MAX_ANTS + 1], rule[MAX_ANTS + 1], dir[MAX_ANTS + 1];
  901.    long count;
  902.  
  903.    /*-=-=-=-=- long block of setup code elided -=-=-=-=-*/
  904.  
  905.    maxpts = maxpts / (long) INNER_LOOP;
  906.    for (count = 0; count < maxpts; count++)
  907.    {
  908.       /* check for a key only every inner_loop times */
  909.       kbdchar = keypressed();
  910.       if (kbdchar || step)
  911.       {
  912.          int done = 0;
  913.          if (kbdchar == 0)
  914.             kbdchar = getakey();
  915.          switch (kbdchar)
  916.          {
  917.          case SPACE:
  918.             step = 1 - step;
  919.             break;
  920.          case ESC:
  921.             done = 1;
  922.             break;
  923.          case RIGHT_ARROW:    case UP_ARROW:
  924.      case DOWN_ARROW:    case LEFT_ARROW:
  925.      case RIGHT_ARROW_2:    case UP_ARROW_2:
  926.          case DOWN_ARROW_2:    case LEFT_ARROW_2:
  927.        setwait(&wait);
  928.             break;
  929.          default:
  930.             done = 1;
  931.             break;
  932.          }
  933.          if (done)
  934.             goto exit_ant;
  935.          if (keypressed())
  936.             getakey();
  937.       }
  938.       for (i = INNER_LOOP; i; i--)
  939.       {
  940.     /* -=-=- inner loop of ant processing omitted; no I/O here -=-=- */
  941.       }
  942.    }
  943. exit_ant:
  944.    return;
  945. }
  946.  
  947. =====================================================================
  948.  
  949.  
  950. so what we have here in pseudocode is:
  951.  
  952. big_while_loop():
  953. initializes big while loop state
  954. loops forever
  955.     get input and call main_menu_switch()
  956.  
  957.     main_menu_switch():
  958.     parses input and calls ant()
  959.  
  960.         ant():
  961.         ant() calls TurkMite1()
  962.  
  963.         TurkMite1():
  964.         initialize local ant state
  965.         for each point to be plotted
  966.             if key pressed
  967.             if ESC pressed
  968.                 return
  969.             else
  970.                 process input locally
  971.             endif
  972.             endif
  973.             do increment of work using ant state
  974.         endfor
  975. done
  976. cleanup
  977.  
  978. So what we have inside this "calculation" is some exit logic (if ESC
  979. pressed), some input processing logic, and some incrmental work to be
  980. done.
  981.  
  982. Every routine that handles keyboard input in fractint is like this,
  983. except that some of them don't have incremental background processing
  984. they could do while waiting for input, so they just block waiting for
  985. input.  The text menu routines are an example of that kind of input
  986. processing.
  987.  
  988. Most "background processing" routines continue working until a key is
  989. pressed and then they return control to a menu or their caller (such
  990. as what TurkMite1 does when you are running the ant simulation and
  991. press ESC, returning control to the main fractal routine which
  992. processes the ESC as a signal to throw up the main menu).
  993.  
  994. Under an event processing organization, you would localize all the
  995. event processing to the main routine.  In Win32 this is the main
  996. message pump loop implemented with the usual GetMessage() and
  997. DispatchMessage().  In X11 its the event loop implemented around
  998. XNextEvent() and XtNextEvent().  The Mac has its own event loop
  999. processing routines as well.  In pseudocode, it looks more like this:
  1000.  
  1001. "idle processing style"
  1002. big_while_loop():
  1003. initializes
  1004. quit = false
  1005. while (!quit)
  1006.     if (event)
  1007.     get event
  1008.     if (quit event)
  1009.         quit = true
  1010.     else
  1011.         dispatch event to input sink:
  1012.         if (keymap[input key])
  1013.             call handler through (*keymap[input key])()
  1014.  
  1015.             handler for ^A on main menu (evolution of
  1016.             main_menu_switch):
  1017.             set idle routine to ant idle routine
  1018.             set idle state data to new ant idle state
  1019.  
  1020.         endif
  1021.     endif
  1022.     else if (idle routine)
  1023.     call idle routine with idle state data
  1024.     if (idle routine done processing)
  1025.         reset idle routine
  1026.         reset idle state data
  1027.     endif
  1028.     endif
  1029. done
  1030. cleanup
  1031.  
  1032. "threads style"
  1033.  
  1034. GUI thread:                    worker thread:
  1035.  
  1036. big_while_loop():                initialize
  1037. initializes                    while (!quit)
  1038. create worker thread                    obtain work item
  1039.                             do incremental work
  1040. quit = false                    done
  1041. while (!quit)                    cleanup
  1042.     if (event)
  1043.     get event
  1044.     if (quit event)
  1045.         quit = true
  1046.     else
  1047.         dispatch event to input sink
  1048.     endif
  1049.     endif
  1050. done
  1051. wait for worker threads
  1052. cleanup
  1053.  
  1054. The big difference between the two styles is that the single event
  1055. loop construction means you have to store intermediate data that is
  1056. communicated from one incremental work step to the next available
  1057. through a pointer or global variable.  So that means that the local
  1058. variables and local state initialized in TurkMite1() would have to be
  1059. stored in a piece of memory to be passed to each successive invocation
  1060. of the incremental work procedure that replaces TurkMite1 in the event
  1061. scheme.
  1062.  
  1063. By localizing the event mechanism to one place it becomes reasonable
  1064. to replace it with other event mechanisms such as event dispatching
  1065. under MFC, Win32 dialogs with their own message procs, Motif/Xt event
  1066. dispatching, and so-on.  This will allow fractint to eventually evolve
  1067. in the direction of a professional "Mac look and feel" interface
  1068. coexisting on the same code base as a professional "Win2000 look and
  1069. feel" interface.
  1070.  
  1071. This is my hope for fractint -- that it can evolve to having
  1072. professional looking interfaces native to the platform.  It may or may
  1073. not be possible.  Or it may be too much work and it may be easier to
  1074. evolve the current event processing in the keyboard code.  For now its
  1075. probably easier to just get the existing stuff working with the driver
  1076. interface rather than undertake so large a code change.  The driver
  1077. was a big enough change as it was and that already consumed my time
  1078. and passed on to someone else :-)
  1079. --
  1080. <http://www.xmission.com/~legalize/>    Legalize Adulthood!
  1081.     ``Ain't it funny that they all fire the pistol, 
  1082.       at the wrong end of the race?''--PDBT
  1083.       <http://www.xmission.com/~legalize/who/>
  1084.  
  1085. Thanks for using Fractdev, The Fractint Developer's Discussion List
  1086. Post Message:   fractdev@lists.xmission.com
  1087. Get Commands:   majordomo@lists.xmission.com "help"
  1088. Administrator:  twegner@fractint.org
  1089. Unsubscribe:    majordomo@lists.xmission.com "unsubscribe fractdev"
  1090.  
  1091.