Answer Questions
andreas s SpaceWars - can you work around Shader limitations?
Two days ago I started working on the XNA framework. This is also the first time I've had any dealings with C# or DirectX. I got the first game tutorial working pretty easily, but I couldn't get the SpaceWars starter kit to run properly. Firstly, I had to set AllowMultiSampling to false (this is a known, and widely discussed problem), and also switch to keyboard mode. With this done, the game ran, but I could not see some of the graphics (ships, backdrop & bullets) in either retro or evolved mode. Score and explosions appeared ok. As far as I can tell, this is because the missing graphics are using CompiledEffect shader objects which are loaded from the FX files. My poor graphics card (Nvidia GeForce 440MX) doesn't support any shader ...Show All
Jun_1111 get stencil buffer
how can i get the stencil buffer as a texture so i can draw it on a sprite (need the stencil to debug my shadow volumes) Cheers. I assume you use Direct3D 9. Direct3D 9 doesn’t support copy operations with depth stencil surfaces. If you want to debug your stencil buffer content you should draw to use stencil buffer operations to update a render target in a way that shows you what you want to see. hmm, ok cool :) ...Show All
robydx Cant Light Mesh...Help..
I am trying to light a simple mesh created by calling d3dxCreateBox(); I can render the mesh without lighting and it will be white but the moment i turn lighting on it wont light... Code follows... sry for formatting... LPD3DXMESH g_Cube; LPDIRECT3DDEVICE9 InitializeDevice ( HWND han_WindowToBindTo); void DrawScene (LPDIRECT3DDEVICE9 p_dx_Device); void SetUpCamera (LPDIRECT3DDEVICE9 p_dx_Device); LPDIRECT3DDEVICE9 InitializeDevice(HWND han_WindowToBindTo) { LPDIRECT3D9 p_dx_Object; LPDIRECT3DDEVICE9 p_dx_Device; p_dx_Object = Direct3DCreate9(D3D_SDK_VERSION); if (p_dx_Object == NULL) MessageBox(han_WindowToBindTo,_T("DirectX Runtime library not installed!"),_T("Init ...Show All
steveareno 3D Math
Does XNA include libraries to help with all the 3D math in graphics programming for instance transforms, clipping, collision detection etc etc It seems a good idea to code all the algorithms into a library, that's what I would do anyway. Is this in XNA I haven't installed it yet and checked out whats there, just mentioning its importance. It is pleasing then to see that such a library is being developed. Even if the XNA team doesn't include this in the framework, the door is wide open for the community to do this with ease. The componentization of things makes this much more feasable than ever before. yes , I will be realse a ...Show All
tonyCuck How I get the index array from a model?
I load a model from file into XNA and I want to store the data for modifying the vertex and adding some vertices and make some other transformations, like grouping all the small models in one single vertex buffer and index buffer and making a basic collision detector with walls. I have followed the issue and I found this topic http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=891302&SiteID=1 Ok, It wasn’t easy, but finally I can manage to get the vertex of the models. But when I try to get the data from the index buffer I get this error "You cannot call GetData on a resource that was created with ResourceUsage.WriteOnly." And the ResourceUsage prop ...Show All
r3n Unified Input
It's my biggest gripe about XNA and directx, there's no unified input... I don't have a 360 controller hooked to my pc, not even sure if that is possible... is it Anyhow, since i took the whole unified input idea from Lynn T Harrison's book, i'll share it here in hopes that people can email me suggestions and feedback. The enum translations aren't finished yet and the InputManager is a singleton (i'm on a singleton kick lately don't know why), and obviously the gamepad implementation isn't finished. Hopefully you can sortof see where i was headed with the 360 implementation... wel here it is, i guess email me at jhered at yahoo com if you have suggestions. You can purchase a 360 ...Show All
Gagandeep Singh XNA doomed?
XNA may be the greatest thing since sliced bread, but I don't see it getting a lot of support until you make a simple web page that explains what features the XNA framework supports and why I would want to use it. I'm not going to download the thing just to figure out what it is. I'm biting back my sarcasm, but there is blood in my mouth now. So, trying to restrain myself here. Because you don't see any reason to download XNA, that means that XNA is doomed. The currently thriving and growing community surrounding XNA is doomed because you, in all your experience and wisdom, have suddenly made the decision for the rest of use that there really is no reason to download XNA and all those projects we've be ...Show All
JALenz Where is the download?
It is 12:48 pm here (GMT + 1)... in Nuku'alofa (GMT + 13) it is tomorrow... So where the hell is my download link :-D It's just gone Close of Business 30/08/2006 here in Oz. Please Santa, bring it on!!! It's just about 12:30 AM, my guess is you'll still have to wait several more hours, probably at least 8 and a half since the workday starts for most people in the US around 9 AM. Even then I don't expect to see it until later in the afternoon Pacific time. It's 4:57 PM here in Adelaide, Australia.. I've been waiting since 2:00 PM for the download and it's still not out! In Nuku'alofa (GMT + 13) it should be Aug 30th now... ...Show All
Matt Stum Should shaders be getting disposed on device reset?
Under MDX 1.1, once a vertex/pixel shader was compiled, the resulting compiled shader was good for the life of the application, and was still valid even after a device reset. However, under XNA, compiled shaders seem to go into an invalid state when the device is reset - attempting to set GraphicsDevice.VertexShader to a shader compiled before the device reset results in an AccessViolationException. Has the requirement on needing to compile shaders after a device reset changed between MDX 1.1 and XNA, or am I looking at a potential XNA bug XNA is build in a way to dispose all resources in the default pool before the device is reseted if you don’t do it. Seems you have found a way that breaks this behavi ...Show All
Shawn Wildermuth - MVP (C#) Dynamically casting an object of unknown type
Hello everyone! I think I've got a tough problem for you. I've got a List<object> full of various types of objects, and I want to grab an element from the list and cast it back as the type of object it actually is. Ideally, what I would do is something along the lines of: List<object> objects = new List<object>(); MyClass instance = new MyClass(); objects.add(instance); object something = objects[0]; Type somethingtype = something.GetType(); somethingtype variable = (somethingtype) something; this works fine except for the last line. Once I have the type of the object, I can't use that to either declare a new variable of that type, nor can I use it for casting (as far as I know). Does anyone know of a way to use Type info ...Show All
su45937 TorqueXNA
I had a look at the XNA version of the Torque 2d engine and noticed that it converted 4mb worth of png files into over 60mb of xna files; Is this a Torque issue or xna as its a massive increase and would make releasing any games online a virtual impossibility. Thanks Shawn, but I'm not sure if that answered the question. For example, I have a splash screen that goes from 5.21kb in PNG format to 1.10MB (1126.4kb) in XNB format - over 216 times bigger. Is there something I have to change in the properties for that file to keep it from getting inflated There is nothing inherent in converting PNG to .xnb format that will make the files larger: it all depends what output format you are converting them ...Show All
knvdssr vb.net project
the project that you get when you select 'Windows Game (XNA)' in the C# Express, but converted to vb.net written with Studio 2005 Professional: http://workspaces.gotdotnet.com/basicXna more samples converted to vb.net to follow, doesn't unchecking "Microsoft.VisualBasic" in the Reference section of the Project's properties do the same thing And I'm pretty sure there is a another solution that involves using the <documented>sdkpath switch in vbc.exe too. (ref: http://www.codeproject.com/useritems/novbruntimeref.asp df=100&forumid=327076&exp=0&select=1657067#xx1657067xx ) So, again what is really stopping this from working in the x360 ...Show All
SaintAnger SpaceWar with a PC controller?
Hello, I was experimenting the SpaceWar application, but it seems to expect a xbox360 controller instead of a broad PC controller since... well, I'm running it on a PC. Do you know anything about that I should be able to use it. I have a team that wants to use XNA for the PC platform - we could hardly care about the xbox360 at the moment. Forcing our players to have a xbox360 controller when they already have a fully capable controller does not make any sense. Did XNA leave out DirectInput or something I'd hate to drop back into MDX just because of this necessity. If MS has no answer for this, may I suggest that DirectInput should be included in XNA when the program detects its running on a PC Average Joe may not want to play the game ...Show All
arby99 question on creating custom background
Hello all ^^ I was wondering if anyone would be so kind as to let me know how to create my own custom background into my game. I used The Gimp to make kind of a Space-looking .png file, but im not quite sure as to how to go about replacing the CornFlowerBlue color background with the picture. Any help would be much appreciated. Thankyou! ^_^ You still will clear your device with a set Color (you can choose whatever you want since you're going to be filling the whole window with your background), but then you will draw a sprite on that background that fills the whole screen. You will declare a class level variable to hold your texture. Something like this. Texture2D mBackgroundTexture; Then w ...Show All
GetCode What is a graphics engine?
Ok just what is a graphics engine i am very good at making algorithms to describe what happens to something or calculating various things that would happen in a game but i am completely clueless when it comes to graphics. Does a graphics engine take care of actually displaying my stuff on screen In other words I tell it the objects location in 3d space, its direction, and it takes care of the actually displaying the scene. How do I determine what was clicked In business programming I double click the control and it brings up the event handler for the control. In a game environment do I have to calculate based off of mouse position what was clicked. If I do have to calculate mouse position do i loop through everything that is ...Show All
