1. Exotica, DirectX & Neil

Hi Todd and Talvitie,

First, thanks to Talvitie for posting the Neil example of directly writing
to the screen.  I was going to post but you beat me to it.  blink  Neil2 has
a new routine called convert_pixels which takes a source address of
poke4'd (32-bit color) data and converts it to any bit depth
(8,15,16,24,32) to a destination address (usually a virtual screen).

I plan to someday add DirectX support to Neil2, by way of either Todd's
library or raw dll calls.  Neil2 forces double-buffered display so now the
programmer must call update_screen or update_area before graphics
operations become visible on the screen.  Under DirectX this would be
optimally accomplished by using a secondary surface in video ram that
would be used as the back buffer.  If Neil2 can get the address of that
secondary surface, it could wrap it in a virtual screen and use it
directly in all the blit operations.  The update_screen procedure would
only then have to tell directX to copy that surface to the visible part of
video memory, which could possibly be accelerated depending on the
hardware capability.

Unfortunately, my current development machine has Windows 2000 which
doesn't appear to work with my graphics card... poop.  I plan on adding
DIB support in a Window under win32, which I can run using exw in
Wine under Linux.

Later,
 _______  ______  _______  ______
[    _  \[    _ ][ _   _ ][    _ ]
[/| [_] |[/| [_\][/ | | \][/| [_\]
  |  ___/  |  _]    | |     |  _]
[\| [/]  [\| [_/] [\| |/] [\| [_/]
[_____]  [______] [_____] [______]
xseal at harborside.com  ICQ:13466657
http://www.harborside.com/home/x/xseal/euphoria/

new topic     » topic index » view message » categorize

2. Re: Exotica, DirectX & Neil

Hi Pete,

This does interest me. Since Exotica also, currently, only supports
double buffering, the merge of Neil2 and Exotica does seem quite
possible. I do have the functions SURFACE_PITCH, SURFACE_POINTER, and
a BPP routines currently implemented in Exotica which could very
well serve in merging the two libraries. I just need to test
the code that was given to me and make sure these three exotica
functions are coded right to handle the task.

Also, Does Euphoria's Read_Bitmap function return a sequence of a
256 colored bitmap? I haven't even got a chance to explore the
Euphoria's DOS graphic routines, yet or even the insides of Neil.
I'll look at Neil again tommorrow and see if I can get a bitmap
loaded useing Neil so I can furthor experimentation with the code
I have. Right now, I need sleep. Zzzz...

Talk ta ye laters...

-- Todd Riggins

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

3. Re: Exotica, DirectX & Neil

M King wrote:
>Sounds like you have the expired direct x 6.1 instead of the full =
version.
I was quessing something like this... thanks :)
>Keep up the good work!
Thanks again...I'll try!


>> I'm a bit interested of doing .dll files. How do you do 'em? Where =
can I find help on it?
>Todd wrote:
>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.

I've wanted visual C++ for long time now but don't want to invest any =
money. So I quess I wont see it soon...
I have no intrest for Direct 3D for now. maybe later, who knows! I've =
heard that it's very slow but that should change in directX version 7... =
they say it's going to be somewhat 40% faster. So I'm still trying to do =
the whole 3D part by myself. What I'd like to see in Exotica is =
DirectDraw which has all the functions as finished as they can be. After =
all, visual is the first thing to do when coding games... am I right? =
Ofcourse I'm also impatient  to see all new things you'll add, including =
Direct Play!

I think I'm going to rewrite my 3D engine once again. I have a few =
reasons to do this, but before I'm going to start, I'd like to select =
the graphics system to do it for. I quess exotica is my select. If and =
propably when I add Dos compability, Neil(2) will be used :)

btw, you, Todd and Pete, should really work together... =
Neil2+Exotica=3DNew page on Euphoria's history!
It would also be great to have only one graphic include file for both =
platforms!

--Talvitie

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

4. Re: Exotica, DirectX & Neil

Hi Todd,

>Hi Pete,
>
>This does interest me. Since Exotica also, currently, only supports
>double buffering, the merge of Neil2 and Exotica does seem quite
>possible. I do have the functions SURFACE_PITCH, SURFACE_POINTER, and
>a BPP routines currently implemented in Exotica which could very
>well serve in merging the two libraries. I just need to test
>the code that was given to me and make sure these three exotica
>functions are coded right to handle the task.

Okay, let me know when you've confirmed the code works.  I'm also working on
some platform-independent keyboard and mouse input routines.  I'll need to
be able to get like get_key(), get key_up/key_down events and mouse location
and button states.

>Also, Does Euphoria's Read_Bitmap function return a sequence of a
>256 colored bitmap?

Yes.  I have also taken the image.e read_bitmap function and hacked it to
support true-color bitmaps for use in Neil.e.

>I haven't even got a chance to explore the
>Euphoria's DOS graphic routines, yet or even the insides of Neil.
>I'll look at Neil again tommorrow and see if I can get a bitmap
>loaded useing Neil so I can furthor experimentation with the code
>I have. Right now, I need sleep. Zzzz...

The insides of Neil are not for the timid.  Most of the code depends on how
certain structures are stored in memory and it does a lot of machine code
modification on-the-fly.  And all the workhorse routines (blit, etc.) are in
chunks of machine code with asm source comments removed to save space.  The
code that generates those blocks of machine code is in neilsrc.ex (I don't
think it has been in Neil2.zip for a while though)

And now some questions... in the DirectX world, what do they call the
routine that blends a source image with the destination surface at 50%?  And
what do they call the routine that adds the color values of two images
together?  The reason I ask is because I'm introducing routines that do this
for Neil2 and I wanted to name them something that people will understand.

Thanks,
 _______  ______  _______  ______
[    _  \[    _ ][ _   _ ][    _ ]
[/| [_] |[/| [_\][/ | | \][/| [_\]
  |  ___/  |  _]    | |     |  _]
[\| [/]  [\| [_/] [\| |/] [\| [_/]
[_____]  [______] [_____] [______]
xseal at harborside.com  ICQ:13466657
http://www.harborside.com/home/x/xseal/euphoria/
>Talk ta ye laters...
>
>-- Todd Riggins

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

5. Re: Exotica, DirectX & Neil

Pete Eberlein wrote:

> in the DirectX world, what do they call the routine
> that blends a source image with the destination surface
> at 50%?

I don't know about DirectX, but the rest of the world calls it alpha
blending.

-- David Cuny

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

6. Re: Exotica, DirectX & Neil

On Wed, 15 Sep 1999 12:26:57 -0400, Pete Eberlein <xseal at HARBORSIDE.COM>
wrote:

>And now some questions... in the DirectX world, what do they call the
>routine that blends a source image with the destination surface at 50%?
And
>what do they call the routine that adds the color values of two images
>together?  The reason I ask is because I'm introducing routines that do
this
>for Neil2 and I wanted to name them something that people will understand.
>

Hi,

As of DX 6.1, DirectDraw provides no means of blending two images/surfaces
in any way (other then simple color keying), though I belive, such
capablities are included in DX 7.0 (I may be mistaken.)

If you want to have DX <= 6.1 blend images, you have to use Direct3D: Setup
one or both images as textures, and then blend away!

Hope this helps,
David

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

7. Re: Exotica, DirectX & Neil

David Guy wrote:
>Hi,
>
>As of DX 6.1, DirectDraw provides no means of blending two images/surfaces
>in any way (other then simple color keying), though I belive, such
>capablities are included in DX 7.0 (I may be mistaken.)
>
>If you want to have DX <= 6.1 blend images, you have to use Direct3D: Setup
>one or both images as textures, and then blend away!
>
>Hope this helps,
>David

and David Cuny wrote:
>I don't know about DirectX, but the rest of the world calls it alpha
>blending.
>
>-- David Cuny

Okay, thanks for the advice Davids!

Neil2 won't use directx to do the blending - it will have it's own machine
code routines that do it fast.  That way it will work on non WIN32
platforms: DOS32 and Linux.

So how about:
"alpha_blit" means blend two images at 50% (or average them)
"blend_blit" means add two images (and saturate)

This naming scheme is currently reversed from the way I have it now. smile

The new blending routines will have a version for rectangular images and a
version for rle sprites.

 _______  ______  _______  ______
[    _  \[    _ ][ _   _ ][    _ ]
[/| [_] |[/| [_\][/ | | \][/| [_\]
  |  ___/  |  _]    | |     |  _]
[\| [/]  [\| [_/] [\| |/] [\| [_/]
[_____]  [______] [_____] [______]
xseal at harborside.com  ICQ:13466657
http://www.harborside.com/home/x/xseal/euphoria/

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

8. Re: Exotica, DirectX & Neil

Pete Eberlein wrote:
> Okay, let me know when you've confirmed the code works.

At this time, I don't know if doing a poke4() to a DirectDraw
surface is possible. Hehe, when I try, it just freezes my computer.
Most likely cause: Not doing it right.
I'm also trying to figure out how to use mem_copy to plaster the image
to the surface. I'm still at it.

>  I'm also working on
> some platform-independent keyboard and mouse input routines.  I'll need to
> be able to get like get_key(), get key_up/key_down events and mouse location
> and button states.

If the Euphoria get_key() doesn't work in a Exotica program,
then I could make a routine with 101 if statements in it to check
what key is pressed and return the scan code value. But I rather
see if the get_key() routine works well or not with Exotica.
DirectX doesn't have a function to return a key value. DirectInput
has a function where I can check a given key value to get it's
state in which Exotica's KEYBOARD_KEYSTATE routine does. The
KEYBOARD_KEYSTATE routine might help you with the Key_up/key_down
events by supplying the scan code value of a key.

I had the wrong description in the EXOTICA documentation about
the MOUSE_X and MOUSE_Y routines in which I need to fix.
The MOUSE_X routine returns the accumulated relative x motion and the
MOUSE_Y routine returns the accumulated relative y motion. So, they
don't return the actual x,y screen coordinates. They just return
how much the mouse has moved.

The MOUSE_B0, MOUSE_B1, MOUSE_B2 and MOUSE_B3 routines returns a value
of 1 if the respected mouse button is pressed, or will just return
0 if it's not pressed.

If you want to, you could look at the Exotica's input.exw example
code to see them in action. If you need help and/or if I
didn't make since of Exotica's Keyboard and mouse routines( most
likely),
please ask me about it.

> Yes.  I have also taken the image.e read_bitmap function and hacked it to
> support true-color bitmaps for use in Neil.e.

Cool.

> The insides of Neil are not for the timid.

I got to admit it, I was a bit timid when I looked. :)

> And now some questions... in the DirectX world, what do they call the
> routine that blends a source image with the destination surface at 50%?  And
> what do they call the routine that adds the color values of two images
> together?  The reason I ask is because I'm introducing routines that do this
> for Neil2 and I wanted to name them something that people will understand.

As I see, David Cuny and David Guy answered this. I do want to
note, after reading David Guy's response, I read an article
about DirectX 7.0 at microsofts/DirectX website that they dropped
the DirectDraw Alpha-blending blit support idea in DirectX 7.0.
Mabie that was to advanced for them to handle??? :(
But I can still use the Direct3D alpha-blending which would work
great for video cards with 3D acceleration support.

-- Todd Riggins

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

9. Re: Exotica, DirectX & Neil

Todd Riggins wrote:

>If the Euphoria get_key() doesn't work in a Exotica program,
>then I could make a routine with 101 if statements in it to check
>what key is pressed and return the scan code value.

In Euphoria you could also use a sequence of 101 times
{key, scan_code} and use the find() function. Ain't I right?
Or you could declare a constant sequence of this form.
But aren't there more combination with the Shift-, Alt- and Ctrl-keys?

Greetings,

 ^  |
/-\<|



 | Gratis e-mail en meer: http://www.dolfijn.nl/
 | Een product van Ilse: http://www.ilse.nl/

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

Search



Quick Links

User menu

Not signed in.

Misc Menu