
ThePentiumGuy
Avatar/Signature-
Posts
1152 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by ThePentiumGuy
-
Alpha-blend Direct3Ddevice with Windows Desktop?
ThePentiumGuy replied to ScalarWave's topic in DirectX
That could work, but constantly grabbing the screen contents would be kind of slow and cumbersome, besides you'd have to minimize all windows and then take the screenshot and save it as a bitmap (Mybitmap.save("file.bmp") and use it and ... well, if you're onnly doing it once, then go for it, but multiple times would be... hard. Either that or I'm not understanding your question. -
Uhh... Heh did you try what I said? And what were the results..
-
Yeah that's possible, but it's referenced by default :O
-
Hey. It might help if you cited where you got your source code from (:mad::mad: :mad: *2 billion - but I'm serious though). I downloaded the source just now, and I don't see anything wrong with it. YOU DONT HAVE SYSTEM.DRAWING?? Just do: Dim b as Bitmap Dim p as Point (Bitmap and Point exist in the System.Drawing Namespace) If that doesn't work (aka:it becomes underlined when you type it in, or it complains about the System.Drawing thing then: -Restart your computer. Create a new project and see if it works. If not then: -Uninstall and Reinstall the .NET Framework SDK (Version 1.1) and see if it works. If not then: -Uninstall .NET and the .NET Framework, and reinstall them both. If not then: -<You're screwed> -The Pentium Guy
-
Hi (why me lol?) Not unless it's your program Create a form and just display the info on a label or something - use some sort of "Always on top" property, and make the form opaque. It's really all up to experimentation. I mean sometimes the d3d app can have its own "Always on top" property enabled. Just try around with a bunch of stuff. Make suer that the d3d app has focus, but your form is bieng displayed. Making your own d3d app and running it on top of the other d3d app would be horrendous - it just doesn't work.... it'll lag. -The Pentium Guy
-
A general general of everything forum...
ThePentiumGuy replied to Georgen's topic in Suggestions, Bugs, and Comments
I ... doubt it ;). See some of the discussions. -
We should move this over to Suggestions/Bugs/Comments. I gotta agree, someitmes it's annoying to not know if it's been deleted.
-
I will be making a set of 5 or 6 tutorials, each of which include source for Visual Basic.NET 2002 and Visual Basic.NET 2003. C# tutorials may or may not follow. These tutorials are to give you guys a jumpstart to some Direct3D. I hope you enjoy these. This tutorial will teach you how to remove that green background. Note: This tutorial is based directly off of my other tutorial: http://www.vbprogramming.8k.com/tutorials/TransparentSprites.htm I have posted a tutorial here for people who do not know my site. Intro This tutorial will be based off of the previous tutorial (Matrices and Transformations). So open up the project from that (you can download the source code at the forums if you wish, or you can just get it from the thread " Managed DirectX 9 (Part 3) - Matrices and Transformations ", in the Tutor's Corner of this site. This tutorial will be very brief, and we'll only be working with clsSprite. Getting Started Open up the source code from the Matrices and Transformations tutorial. I'll be very brief in this tutorial as most of it is pretty simple. In clsSprite's globals: 'This variable will store if the image is Transparent or not Dim IsTransparent As Boolean Change the arguments for Public Sub New of clsSprite: Public Sub New(ByVal lDevice As Device, ByVal ImageName As String, ByVal TopLeft As Point, ByVal Width As Integer, ByVal Height As Integer, Optional ByVal Transparent As Boolean = True) Just in case you don't know what an Optional Argument is: There are some arguments for a function which you type frequently and you don't want to bother wasting time typing. Specifying an Optional argument means, when you call your function - you don't have to use that argument, a default value is provided there. Most of our sprites will be transparent, so we might as well make them transparent by default without having to specify True for the last argument New Sub... understand? It's easier than you think :). Now add this line to the beginning of the New sub: IsTransparent = Transparent Pretty easy so far, it just stores the variable IsTransparent. Now let's modify the Load sub. Add this line after declaring Vertices(): 'This value will store our color that is to be made transparent. 'That color is: Fully Visible (indicated by the first argument) 'and fully green (third argument). 'Basically, our color is LimeGreen (255,0,255,0). Dim ColorKeyVal As Color = Color.FromArgb(255, 0, 255, 0) 'LimeGreen Now replace this block with the line that says SpriteImage = TextureLoader.FromFile(dxDevice, ImageName): 'If our image is transparent Then. If IsTransparent Then 'The following arguments require a very advanced knowledge of Direct3D. So I really don't 'know what most of them do. SpriteImage = TextureLoader.FromFile(dxDevice, ImageName, 32, 32, D3DX.Default, 0, Format.Unknown, Pool.Default, Filter.Point, Filter.Point, ColorKeyVal.ToArgb) 'Arguments from left to right: 'Device, ImageName, Width, Height, MipLevels (Honestly I don't know what this is... so I use default). 'Usage (this is something advanced, so we leave it alone and say 0; use 0 when unsure of anything in Direct3D). 'Format: Heh, instead of guessing the image format (8-bit, 16-bit, 24-bit...etc) and hardcoding it for each image that you have, 'just use Format.Unknown and let d3d figure it out. 'Memory Pool: Let d3d handle the memory stuff, so say defualt. 'Filter & Mip Filter - They affect how the image is rendered. Filter.Point is the clearest and is NOT good if your image is pixilated. 'Try changing both the Filter.Points to Filter.Triangle, you'll get a slightly more blurrier image, 'but it adds a nice "warm" effect. Just mess around with the Filter arguments until you get one that works for you. I use Points for 'clearer images, and Triangle for images that appear to be pixilated and require 'blending' 'Finally, the Color to be made transparent Else 'Set our SpriteImage, non transparent SpriteImage = TextureLoader.FromFile(dxDevice, ImageName) End If Lots of green ^^. Everything that I know about that line is written right there in green. Now let's jump to the Render sub. At the very beginning, do this: 'If the sprite is Transparent, then If IsTransparent Then 'Enable AlphaBlending. The process of mixing a pixel's color + it's inverse color. dxDevice.RenderState.AlphaBlendEnable = True 'A Pixel's color + it's inverse color is a "transparent color" 'Not fully understanding how this works, all I can really tell you is 'that whenever it sees the transparent color (LimeGreen), it 'overlays it with its inverse color, and makes the LimeGreen transparent. dxDevice.RenderState.SourceBlend = Blend.SourceAlpha dxDevice.RenderState.DestinationBlend = Blend.InvSourceAlpha End If The process of Alphablending makes a pixel transparent. You're simply making LimeGreen transparent by using those flags. I honestly do not understand what they mean. If anyone has any information whatsoever, please post on the forums. Thank you. Ok, alphablending takes up a lot of memory, so, disable it when you're done. At the very end of the Render sub: 'Alphablending takes up a LOT of memory, so just disable it when you don't need it. dxDevice.RenderState.AlphaBlendEnable = False Run the program, the (2) sprites should be transparent! Sorry for the lack of explanation, this is something which I don't understand a lot about. Next up: "World Space vs Model Space." Now that is something which I do understand pretty well! So you'll have a lot of explanation going on there. Edit: Sorry, the link for the source code is here: http://invisionfree.com/forums/vbProgramming/index.php?showtopic=38 I don't think you mods have to worry about the source code containing an exe, however, since it's not hosted on your forum. -The Pentium Guy
-
Don't log out. I never log out :P. if you think you're going crazy, screenshots might help. jk..jk I'm used to it. Becuase all I look for is my name to the right of the board
-
Keydown event response time(Simple question)
ThePentiumGuy replied to ThePentiumGuy's topic in Graphics and Multimedia
Sorry, I never got an email notifier for this post (went to junk). Heh, I did the exact same thing you were talking about before I saw this post. I just feel a little weird declaring 4 booleans.. -The Pentium Guy -
www.themexp.org. Edit: Whoops, I already mentioned that.
-
Keydown event response time(Simple question)
ThePentiumGuy posted a topic in Graphics and Multimedia
Hey, I got a quick question. When you hold down a key, windows automatically has a ersponse delay thing. For example open up notepad and hold down K, it pauses after the first K. Sort of like: K <Pause> KKKKKKKKKKKKK. How do I avoid this in my game? This gets really annoying. I want to use as little memory as possible. I tried GetASyncKey state (Win32 API) Form1_KeyDown: If getasynckeystate(keys.down) then Y + = 1 End If It still won't do it. The only alternative I found was resorting to timers: Form1_KeyDown: If e.keycode = keys.down then Timer1.Enabled = True Direction = "Down" End If Form1_KeyUp: If e.keycode = keys.down then Timer1.Enabled = False End If Timer1_Tick: If Direction = "Down" then Y += 1 End If I want to avoid using a lot of memory (ex: By using timers). Is there any way I can do this without using timers? Any quick way? -The Pentium Guy -
A general general of everything forum...
ThePentiumGuy replied to Georgen's topic in Suggestions, Bugs, and Comments
You're talking about Off Topic right? It does help us get out mind off of programming (to vent our anger, to pacify our stress, and to hang out altogether and get to know other members). Heh. I find it pretty useful. -
Well Commented??!! You're kidding right? I see all this ' We won't use this maliciously <System.Marshal.SurpressUnManagedCodeSecurity> And random stuff like that. These guys are using UMDX wrappers in MDX! Sorry. Just a lot of anger I had to let out... When I first started dx9, there was simply NO documentation and I learned through Trial and Error. Hey man, take a look at some of the tutorials I've written (see Tutor's Corner), and check my website (see signature) for more. When I first started off, I tried DirectDraw, but then I found that Direct3D was actually much easier.... for me at least. The tutorials I mentioned are about Direct3D and also explain why you should use Direct3D instead of DirectDraw. However, DirectDraw does have better compatbibilty with older cards and may run a little faster on older systems. Oh also, if you really want to learn, check out the book ".NET Game Programming with DirectX 9" - great book. Awesome for newbs (like I was). They might have renamed the book to something like "DirectX 9 Game Programming with .NET" . Great book, and well explained (in fact, that's where most of my coding styles come from). My 2 cents to you. -The Pentium Guy
-
Loop Function Need In A Form !!! (help!)
ThePentiumGuy replied to Macaco's topic in Graphics and Multimedia
Are you using Managed C++? Tip: If you are, then use C#. I really don't know much C++.NET, but I've done this before in unmanaged. Edit: It says you need to make your form visibilty property to false???? THat's the most retarded thing I've heard. Try creating a new project or something - .NET does go crazy at times (once, it refused to recognize the MessageBox.Show command). -
Operator Overloading in VB 2005 - Dealing with fractions
ThePentiumGuy replied to John
's topic in Tutors Corner
Sounds pretty leet. I'll check it out when I have the time though. -
Loop Function Need In A Form !!! (help!)
ThePentiumGuy replied to Macaco's topic in Graphics and Multimedia
Macaco: Call Me.Show before you call DoTheLoop. I had this same problem earlier. The thing is, the form1_Load event is called before the form is shown. -The Pentium Guy -
Lol. You had to restart your comp? Tip: Name your project starting with a z next time. When it hangs like that, hit control alt delete (you won't see it), hit z, hit delete, and hit enter. It's sort of confusing to explain. Hitting z will go to the next item on the list (in the task manager) that starts with a z and delete is the same as End Task, and hitting Enter will answer Yes to the 'Do you want to end task?' question. Neat little trick. If that doesn't work, then you'll have to alt+tab to what you think is the task manager and give it a try. It usually always works for me though. Unfortunately, one of my applications was named something like DirectXTest1, and hitting d, delete, enter, it quit devenvr.exe (.NET), so I couldn't see the error. Honestly, I don't know the asnwer to your question. -The Pentium Guy
-
Loop Function Need In A Form !!! (help!)
ThePentiumGuy replied to Macaco's topic in Graphics and Multimedia
This is what i do: Public Sub Load DoTheLoop() End Sub Public Sub DoTheLoop() Do While Not GameOver Application.DoEvents 'Do stuff End While End Sub It realy doesn't matter where you call it, becuase when you do applicaiton.DoEvents, the program will also run other subs (ex: When you hit a key, it won't get "stuck" in the loop, it'll go to the key event AND the loop at the same time.) -The Pentium Guy -
Look at my avatar. Agreed IngisKhan :thumbsup:. I've found ATi to run a little cooler (as in, less hot). However as of now (1/21/05), NVidia holds a clear advantage.
-
Loop Function Need In A Form !!! (help!)
ThePentiumGuy replied to Macaco's topic in Graphics and Multimedia
Timers? I'd just do Dim GameOver as Boolean Do While Not GameOver Application.DoEvents 'Do stuff End While 'and then somewhere else: if e.keycode = keys.escape { GameOver = true; } <I tried my best to mix VB.NET / C++ / C# code :P. It seems as though you're using either C++ or C#, pretrty sure C++> -The Pentium Guy -
Reinstall?
-
Well, I would really not recommend you draw on a label (for now at least, try to get it to draw on the form first). Do you have a game loop? That should refresh the form and the drawing automatically. An example of one can be found in the tutor's corner: http://www.xtremedotnettalk.com/showthread.php?t=87687. -TPG
-
Get the latest udpdate for the game and get the latest DirectX update and get the latest drivers for your graphics card.
-
Yikes. Ummm, maybe try using a picturebox, or a label. or draw directly to the form. -TPG