Answer Questions
Keren S Order of DeviceLost, DeviceDisposing, DeviceCreated, DeviceReset, etc?
While the documentation documents the GraphicsDeviceManager.DeviceDisposing, GraphicsDeviceManager.DeviceCreated, and GraphicsDevice.DeviceLost and GraphicsDevice.DeviceReset events, it doesn't document when these will be invoked, and in what order. Assuming the user drags the window from one device to another, I would ASSUME I'll get the following sequence of events: GraphicsDevice.DeviceLost GraphicsDeviceManager.DeviceDisposing <new device is created> GraphicsDeviceManager.DeviceCreated (I can hook up to the new device events here) GraphicsDevice.DeviceReset However, there's nothing that actually guarantees that I'll get the DeviceLost and DeviceReset events. Currently, I don't have a multiple-device system to test on, so I can't ...Show All
Roy mm incorporating c# 2d drawing into the xna template
I recently found the following link that describes how to make 2D primitives in C#: tutorial I would love to be able to use this in my XNA game, but the above example uses a Graphics object that it gets from the PainEventArgs of the form. However, the XNA template uses a GraphicsDeviceManager. Is there any way I could get the Graphics object of the xna game window so that I could draw the things in that tutorial Ok, Jim got there first :P Ok, thanks. It was worth a try anyway. The tutorial on that link covers winforms and GDI+, what you really want to do is learn the XNA way of drawing primitives, you can learn all about it by looking at the XNA docs under Graphics > 3D Graphics > How ...Show All
abuck Wireless GamePad in windows exceptions
Working on a SpaceWars mod, with a wireless GamePad connected using the new Wireless GamePad for windows receiver. I notice that: Y button presses are not being picked up & getting errors in Right Thumbstick 'XInputHelper.GamePads[PlayerIndex.One].ThumbStickRightX' threw an exception of type 'System.Collections.Generic.KeyNotFoundException' 'XInputHelper.GamePads[PlayerIndex.One].ThumbStickRightY' threw an exception of type 'System.Collections.Generic.KeyNotFoundException' anyone else come across this I'm going thru the GamePadHelper.cs class, and it looks consistent for Y with the other keys that work. nice find. I remember looking ...Show All
Tarey Wolf Another Bug???
Hello:)) i have one question: i need run few game objects for example Game1 and next Game2 .... Game3 for example: static void Main( string [] args) { using (Game1 game = new Game1 ()) { game.Run(); } and next game object: using (Game2 game = new Game2 ()) { game.Run(); } when i make Exit() from Game1 program stop on Game1 object and do not run Game2 but when i press "cross" on Game1 window then program go to Game2 normally ,but how to make this programmatically Best Regards Cezaro exit() terminates the app. Try using Dispose() on the game object instead. Perhaps you could borrow the game ...Show All
tribal Reading the buttons of Joystick Saitek x52
Hi all, Did anybody come across a C# sample that relates to Saitek X52 I have found some generic Joystick samples which help me read the buttons EXCEPT the Mode button. The GetButtons() function returns the codes of the pressed buttons, but I cannot get the status of the Mode button out. I just spoke to Saitek support - No .NET samples whatsoever. Any tips will be appreciated. Best Moni. Never mind. It turned that the C++ samples have also the EXE's. I ran the OCTOBER EXE and I got a slightly different result. Now I get "-1" in front of the code of the pressed button. Tonight I will re-install the Saitek drivers and tomorrow I will retest - this time with the FE ...Show All
GustavoPollitzer Projecting 2D Coordinates Into 3D Coordinates
I just got started with XNA (and C# for the most part, though my experience with Java seems to help) and ran into a snag. I did the tutorial about display points using the VertexBuffer object and wanted to take it to another level. I wanted to get the mouse coordinates when the mouse is clicked and put a new point on there. I got the input and figured out how to add points to my array, but unfortunately I can't figure out how to take my 2D screen coordinates from the mouse and put it into 3D coordinates. Does anyone know how I can do this If it matters, here's the code I used to create my projection and view matrices: viewMatrix = Matrix.CreateLookAt( new Vector3(0, 0, 5), Vector3.Zero, Vector3.Up ); ...Show All
Toni Greco What are the best resources for people trying to get started?
All right, simply put, for someone interested in learning how to program, how to design, and how to model, what books or websites would you reccomend most for someone trying to get into Game Development DirectX/OpenGL/Shockwave PC/Console/Mobile/Phone Native/Managed What are your current skills and programming language expertise Otherwise http://www.gamedev.net/reference/start_here/ http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=77027&SiteID=1 ...Show All
haihtomy Setting Effect.Parameters on the fly?
I am looking to setup the ability to set values of parameters in an Effect on the fly. Right now I have a dictionary of type <string, object> which is setup similar to how Effect Parameters are. Effect.Parameter[string].SetValue(...) doesn't take type object though. Maybe I am missing something but is there a way I can do this Yeah, I guess I am just being retarded. I am just going to expose the entire Effect object to the end-user. SetValue has a load of overloads so it does not have to cast it to the correct type, which makes a lot of sense. What is preventing you from setting them on the fly using the normal way ...Show All
.net sukbir Why XNA requires C# Express, not the Studio version?
I'm new to XNA and I'm using VS2005. I just want to use XNA with VS2005 but it requires C# Express to be installed. That's a waste of disk space if I must install another version on my PC. I have two questions: Can I use XNA with VS2005 And if there is no other way, if I must install C# Express on my PC, will any conflict happens with the Studio version However, the download page for C# Express states the following. "Before installing, you must uninstall any previous Beta, CTP or Tech Preview versions of SQL Server 2005, Visual Studio 2005, and the .NET Framework 2.0." So, you're okay with a full version of them, but not with Beta, CTP or Tech Preview versions Cast your vote to ...Show All
ameyayashu unloading model resources
Im trying to figure out how to manually unload models/textures/shaders ect. Halp me Intertron! If you are using the .Net version of DirectX (Managed), you should unload resources with their Dispose() method. You can also check out the ResourceManager included in the Utility Toolkit of ManagedDirectX. It does a big part of the work for you. DirecX runtime is a COM compliant API. It means a lot of things, but especially for your concern that each allocated object has a reference counter. The idea behind this counter is to deallocate the COM object as soon as counter's value falls down to 0. The counter is incremented at creation time, on a call to the COM base interface IUnknow::AddRef or IUnknow::QueryInterface. To ...Show All
rksinghal Problem with DrawUserPrimitive(), MRT's, while using the D3D debug runtime
This is a bit of an odd problem I ran into (seems to be the only ones I find hehe). I have a windows forms application that is using XNA to render to a window. I am using deferred shading so it involves many full screen quads being rendered to and then finaly composed for the final scene. All of these full screen quads are being rendered using DrawUserPrimitive(). When I call DrawUserPrimitive() to render the final scene to the back buffer using the Debug D3D runtime I get an InvalidOperationException. Switching to the retail D3D runtime fixes this problem. Anybody have an idea why this could be or should I submit a bug report on Connect Full screen quad code: m_shader . BeginCombinePass(); RenderToTexture(m_device . Viewport . Wi ...Show All
SQL New Alpha Blending and Render Order
Hi All, I tried to draw few meshs in game. But i has some textures problem. The problem is a meshs collistion another mesh, textures alpha chennal has some problem. Below is capture screen. Who can tell me why How to fix this problem http://hk.geocities.com/brian_tsim/error.PNG Best regards, There is one more thing to consider here - in Quake 3, the Rocket Launcher left a trail of smoke which was represented by many - potentially a hundred - transparent smoke animations arranged in a line. If the player fired a rocket these all stacked on top of each other and the game would get progressively slower as the rocket made more and more smoke images all stacking. They rendered perfectly - probably using this back-to-fron ...Show All
debraj dhar Nvidia Vista Drivers
Hello, I'm seeing a problem with the latest NVidia drivers on Vista (version 97.46 realeased on 5th Jan 2007), and I was wondering if anyone else is experiencing similar problems. The display card is an NVidia GeForce 6800 LE, but I don't think its specific to that display card. The problem I'm seeing is that DrawIndexedPrimitive() doesn't seem to draw anything if the BaseVertexIndex argument in DIP is larger the MaxVertexIndex caps value. The return value from DIP is OK, but it doesn't draw anything. I'm drawing representations of oil reservoirs made up of a large number of quads. The whole reservoir goes in a single vertex buffer which can often exceed 100MB in size. I am using an index buffer containing around 3000 indices. The co ...Show All
AlexPil retrieving data from gamecomponents
Hi all. I'm hoping someone can point my confused self at the (probably simple) solution to my problem. The only way I can find to access information from added components (Components.Add(myCoolComponent);) is to create myCoolComponent as a 'global' object in my main game. I wouldn't feel so bad, though it _seems_ like a good way to use up RAM, but if I need to find myCoolComponent.position in an instance of a class I'm forced to pass the original copy of myCoolComponent around all the time; and that can't be good. What I imagine I'm looking for is something like: game.Components.myCoolComponent.position. //confused! Just loops through your components: foreach(GameComponent com ...Show All
gafferuk Create Volumetric Light using shadowMaps
Hi, i read a paper from nvidia about shadowmaps( http://developer.nvidia.com/attach/6769 ) and it tells about suspended dust effects( volume ) : Simulate atmospheric effects such as suspended dust 1) Construct shadow map 2) Draw scene with shadow map 3) Modulate projected textureimagewith projected shadow map 4) Blend back-to-front shadowedslicing planes also modulated by projected texture image The steps 1,2 and 3 are easy, but how i can do the 4 and how put all together ...Show All
