smashly Posted April 10, 2007 Posted April 10, 2007 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. Cheers
CoderDunn Posted April 10, 2007 Posted April 10, 2007 (edited) I just updated my first post.It supports sprites now -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 April 10, 2007 by Hallman
cppman Posted April 10, 2007 Author Posted April 10, 2007 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. Miva OS Project
CoderDunn Posted April 10, 2007 Posted April 10, 2007 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
cppman Posted April 10, 2007 Author Posted April 10, 2007 whoa your fast. Thanks!Hallmanhaha.. i was working on it before you asked Miva OS Project
CoderDunn Posted April 10, 2007 Posted April 10, 2007 (edited) haha.. i was working on it before you asked 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 April 10, 2007 by Hallman
cppman Posted April 10, 2007 Author Posted April 10, 2007 (edited) 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 (the transparent color is 0xFFFFFF - white) Edited April 10, 2007 by chris95219 Miva OS Project
CoderDunn Posted April 10, 2007 Posted April 10, 2007 (edited) 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 (the transparent color is 0xFFFFFF - white)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 April 10, 2007 by Hallman
cppman Posted April 10, 2007 Author Posted April 10, 2007 (edited) 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. Edited April 10, 2007 by chris95219 Miva OS Project
CoderDunn Posted April 10, 2007 Posted April 10, 2007 (edited) 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. 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 Edited April 10, 2007 by Hallman
cppman Posted April 10, 2007 Author Posted April 10, 2007 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 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. Miva OS Project
CoderDunn Posted April 10, 2007 Posted April 10, 2007 (edited) 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. oh I see. Cant find the example sorry ... there are a bunch included with the DirectX 9 SDK have a look there ... Edited April 10, 2007 by Hallman
cppman Posted April 10, 2007 Author Posted April 10, 2007 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 Thanks for the comments and suggestions! Miva OS Project
smashly Posted April 10, 2007 Posted April 10, 2007 Thank you for the updated pixel ex function. nice 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
CoderDunn Posted April 10, 2007 Posted April 10, 2007 (edited) 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): Edited April 10, 2007 by Hallman
cppman Posted April 10, 2007 Author Posted April 10, 2007 (edited) 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). , If you know how to rotate surfaces, please let me know 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 April 10, 2007 by chris95219 Miva OS Project
CoderDunn Posted April 11, 2007 Posted April 11, 2007 (edited) 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). , If you know how to rotate surfaces, please let me know 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 April 11, 2007 by Hallman
cppman Posted April 11, 2007 Author Posted April 11, 2007 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 lol. Miva OS Project
CoderDunn Posted April 11, 2007 Posted April 11, 2007 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 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
cppman Posted April 11, 2007 Author Posted April 11, 2007 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.HallmanAlright, I'll try to figure it out .Hope you have fun in North Dakota! Miva OS Project
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now