Jump to content

Direct3D


cppman
 Share

Recommended Posts

Thank You chris95219 for your excellent work.

I'm surprised theres not been more feedback on your plugin so far.

I really been enjoying playing with your dl, it's a great effort

It's impressive how little cpu usage it uses , and it's quick and seems to handle quite stable for what it supports. :(

At this rate it won't be long before we start seeing alot of mini games written with your dll. :shocked:

Cheers

Link to comment
Share on other sites

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I just updated my first post.

It supports sprites now :shocked:

-I think that is all the functions I'm going to add.. the rest seem pointless.(Getting the number of adapters and stuff like that can easily be done through the registry).

Oh please don't stop now! You should add support for muiltiple sprites in the same file (parameters for the x and y of the sprite location in the file), and sprite animation since directX has built in functions to handle those (I think)

Edited by Hallman
Link to comment
Share on other sites

Oh please don't stop now! You should add support for muiltiple sprites in the same file (parameters for the x and y of the sprite location in the file), and sprite animation since directX has built in functions to handle those (I think)

lol, ok. Done. The function is called, A2DDrawSpriteEx($id, $src_x, $src_y, $src_width, $src_height, $dest_x, $dest_y, $dest_w, $dest_h)

it'll load a rectangle from the file, and display it on the screen.

Link to comment
Share on other sites

lol, ok. Done. The function is called, A2DDrawSpriteEx($id, $src_x, $src_y, $src_width, $src_height, $dest_x, $dest_y, $dest_w, $dest_h)

it'll load a rectangle from the file, and display it on the screen.

whoa your fast. Thanks!

Hallman

Link to comment
Share on other sites

haha.. i was working on it before you asked :shocked:

ah I see. Can I make a tiled background with the draw sprite function? I'm just wondering if the transparency will work right if the sprites are top of one another because if you move the ship over the text you can see a black box around the ship.

Edited by Hallman
Link to comment
Share on other sites

ah I see. Can I make a tiled background with the draw sprite function? I'm just wondering if the transparency will work right if it's sprites on top of one another because if you move the ship over the text you can see a black box around the ship.

Yep. Well, the actual image has to be transparent. The one's in the demo aren't because I just threw it together really quick..

here is a sample image you can use :shocked: (the transparent color is 0xFFFFFF - white)

Posted Image

Edited by chris95219
Link to comment
Share on other sites

Yep. Well, the actual image has to be transparent. The one's in the demo aren't because I just threw it together really quick..

here is a sample image you can use :shocked: (the transparent color is 0xFFFFFF - white)

Posted Image

ok thanks yet again. One last thing ... iv'e seen GUI controls made with directX ... is that to complicated? Because it would be an easy way for people to make custom skins (I think). But this might not work with AutoIt I don't know. Thanks for all your help.

Edited by Hallman
Link to comment
Share on other sites

Sratch what I just wrote.. lol. I found something in the Direct3D Docs :shocked:, i think i will take a crack at it.

hmm.. I don't think I can do it(Anyone else care to try adding that?).. you can try creating your own controls using the basic functions. :(

Edited by chris95219
Link to comment
Share on other sites

Sratch what I just wrote.. lol. I found something in the Direct3D Docs :(, i think i will take a crack at it.

hmm.. I don't think I can do it(Anyone else care to try adding that?).. you can try creating your own controls using the basic functions. :P

ok i have some C# examples ... you want to have a look at them?

EDIT changed your example a bit so it will still show part of the ship if it moves off the window :shocked:

Edited by Hallman
Link to comment
Share on other sites

ok i have some C# examples ... you want to have a look at them?

EDIT changed your example a bit so it will still show part of the ship if it moves off the window :shocked:

Thanks,

well.. the thing is, DXUT is "event based" meaning that it will call a function for you whenever an event occurs(button is clicked, or updated). So I wouldn't have any way to dynamically manage all of the callbacks. :(

Link to comment
Share on other sites

Thanks,

well.. the thing is, DXUT is "event based" meaning that it will call a function for you whenever an event occurs(button is clicked, or updated). So I wouldn't have any way to dynamically manage all of the callbacks. :shocked:

oh I see. Cant find the example sorry ... there are a bunch included with the DirectX 9 SDK have a look there ...

Edited by Hallman
Link to comment
Share on other sites

oh I see. Cant find the example sorry ... there are a bunch included with the DirectX 9 SDK have a look there ...

yeah, thats where I got it from.. hmm, It looks like you have to initialize everything using DXUT.. like the device and everything. I'll try to find a different way of having a GUI in there.. but I'm done for tonight :shocked:

Thanks for the comments and suggestions!

Link to comment
Share on other sites

Thank you for the updated pixel ex function. nice :shocked:

I noticed the demo seemed to chew alot more cpu usage this time round..

Sleep(1) added to the start of the While loop seems to lower the cpu usage greatly while keeping the speed of the graphics rendering pretty much the same.

Just a trivial observation.

Cheers

Link to comment
Share on other sites

Now ... if only we could draw 3d objects with this :shocked:

Also, is it possible to rotate sprites?

EDIT: sry to keep bugging u but how do i get this sprite to have a transparent background? It has a alpha channel but it shows up as light blue. Thanks, Hallman

sprite (Mario_Stand.png):

Edited by Hallman
Link to comment
Share on other sites

Now ... if only we could draw 3d objects with this ;)

Also, is it possible to rotate sprites?

EDIT: sry to keep bugging u but how do i get this sprite to have a transparent background? It has a alpha channel but it shows up as light blue. Thanks, Hallman

sprite (Mario_Stand.png):

Well, you are setting the "alpha" color as black(0x0). Also, since you are using the format A8R8G8B8 there are 8 bits per channel including the alpha channel. You need to figure out what color that is(in hex), and put it in the trans_color parameter... For example(if the background was white), then you would set the transparent color as white with 255 as the alpha value.. which in hex would be: 0xFFFFFFFF.

I'm not to sure how to rotate sprites because I'm using surfaces(not the Direct3DXSprite class). :shocked:, If you know how to rotate surfaces, please let me know :P

As for 3D objects, I can't do it. lol, I've just started learning how to use the 3D part of Direct(3D) and it's not coming along too well :(

Edited by chris95219
Link to comment
Share on other sites

Well, you are setting the "alpha" color as black(0x0). Also, since you are using the format A8R8G8B8 there are 8 bits per channel including the alpha channel. You need to figure out what color that is(in hex), and put it in the trans_color parameter... For example(if the background was white), then you would set the transparent color as white with 255 as the alpha value.. which in hex would be: 0xFFFFFFFF.

I'm not to sure how to rotate sprites because I'm using surfaces(not the Direct3DXSprite class). :shocked:, If you know how to rotate surfaces, please let me know :P

As for 3D objects, I can't do it. lol, I've just started learning how to use the 3D part of Direct(3D) and it's not coming along too well :(

ok. I cant figure out the hex of the alpha channel ... guess I'll have to make the background white. Iv'e been working with directX 8 for a while and I think in the book I have there is an example of how to rotate sprites. I bet directX 8 isn't completly different that 9.

Edited by Hallman
Link to comment
Share on other sites

ok. I cant figure out the hex of the alpha channel ... guess I'll have to make the background white. Iv'e been working with directX 8 for a while and I think in the book I have there is an example of how to rotate sprites. I bet directX 8 isn't completly different that 9.

For that blue color it is: 0xFF0088FF. But i'm not sure if it would work like that, I would just set the background to white and set the transparent color as, 0xFFFFFFFF.

Probably not. I know the rotation has something to do with setting the world transform.(device->SetTransform()). But It never works for me :shocked: lol.

Link to comment
Share on other sites

For that blue color it is: 0xFF0088FF. But i'm not sure if it would work like that, I would just set the background to white and set the transparent color as, 0xFFFFFFFF.

Probably not. I know the rotation has something to do with setting the world transform.(device->SetTransform()). But It never works for me :shocked: lol.

Yeah thats what I was going to do with the trans. I hope you figure out the rotation, as this plugin could become very usefull for people. I'm off to North Dakota tomorrow ... wont be back till sunday. Thanks for all your hard work.

Hallman

Link to comment
Share on other sites

Yeah thats what I was going to do with the trans. I hope you figure out the rotation, as this plugin could become very usefull for people. I'm off to North Dakota tomorrow ... wont be back till sunday. Thanks for all your hard work.

Hallman

Alright, I'll try to figure it out :shocked:.

Hope you have fun in North Dakota!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...