Jump to content
  • Advertisement

ELFanatic

Member
  • Content Count

    187
  • Joined

  • Last visited

Community Reputation

100 Neutral

About ELFanatic

  • Rank
    Member
  1. ELFanatic

    details on memory chips

    Quote:Original post by KrazeIke On x86, each byte can be addressed individually. Oh yeah, that's so true, what was I thinking? Thanks man. Sometimes you need someone to point out the obvious.
  2. ELFanatic

    details on memory chips

    Quick question, I learned in school but I'm forgetting now. On a 32 bit machine, how many address locations does a 4GB chip have? And how many bytes are at each address location? I thought there were 4 bytes at each address location so that means there are 1 GB of addressable locations? correct?
  3. ELFanatic

    Visual Basic or C++?

    I definitely suggest you code in C/C++ for a period of time, it'll help you become a better programmer.
  4. ELFanatic

    [.net] C# safe pointers

    Quote:Original post by Mike.Popoloski C# allows you to define two different kinds of types: value types and reference types. Objects you create using the class keyword are reference types, whereas object created using the struct keyword are value types. The distinction is important, as it affects several properties about your object. One of them is the way they are passed between functions and and operators, as you yourself have found out. Value types (which includes the Matrix type) are always copied. Reference types only have their reference (acts like a pointer to the type) passed around. While there aren't any explicit provisions in the language for storing references to value types, if you need the value type to be changeable from within a method, you can pass it using the ref keyword, which will pass a reference to the type. I suggest reading up on value types and reference types to get a better handle on the subject. aww I did not realize it was a struct. That does explain a lot. Perhaps your right and I should read up more on structs. I forget that their different from C. I think you pretty much answered all my questions. Thank you.
  5. ELFanatic

    [.net] C# safe pointers

    sorry I caused a lot of issues with the passing by reference comment. I just did a public void foo(aClass theObject) I was having issues with assigning an object of type Matrix from the XNA library (I forget the namespace now) I was just stupid, I'm sure it does a deep copy and passes back the copy but for some reason I was expecting it to act more like a pointer or reference assignment. The way I figure it works is like this. Matrix r; Matrix t = r; //copy constructor called and passed back. But I was thinking it was going to work like this. Matrix r; Matrix * t = &r; Basically, I wasn't thinking. So, correct me if I'm wrong, there's no safe way of doing the latter, is there? If I ever assign an object it'll always get a copy, there's no way of just getting it to reference the object. (though the wrapper class is pretty ingenius if all else fails) Just for future knowledge. I fixed this issue a couple days ago. Sorry for the late reply.
  6. I have an issue that has occured while programming in C# that I didn't think would occur. I pass an object by ref and try to assign it to a private member variable but when I change the value of the private member I realized that the private variable was not pointing to the same data that was passed in. Is there anyway I can do this with a safe pointer or do all safe pointers get assigned to clones. It wouldn't be too big of an issue to do it unsafely but I'd prefer to do it safely.
  7. ELFanatic

    [.net] spriteBatch and 3D XNA

    nevermind about the random null, I think I figured it out, I'll still ask the last question though, does it matter if I mix the two methods of drawing?
  8. I am writing a 2D game and I was using sprite batch and all was workign well but then I added some textured quads (within 3D space) and now I get a random spritebatch null exception. Spritebatch will draw for awhile before that occurs. I can't figure out why it might be doing this. Is it not a good idea to mix like this? Should I do my spriteBatch before or after my other drawing?
  9. I am writing a 2D game and I was using sprite batch and all was workign well but then I added some textured quads (within 3D space) and now I get a random spritebatch null exception. Spritebatch will draw for awhile before that occurs. I can't figure out why it might be doing this. Is it not a good idea to mix like this? Should I do my spriteBatch before or after my other drawing?
  10. ELFanatic

    [.net] textured quads in XNA

    Actually I did notice an error but I don't think it would cause my error. basically the error is that I'm setting the origin to be at the center no matter what I send it. So I need to fix that but otherwise if I send 1 x 90 then upperLeft is (-.5, 45, z) upperright is (.5, 45, z) and likewise for the lowerhalves with 45 now being negative. Is it the case that vertices can't be negative? What's a working quard vertice order? Thanks for your help.
  11. I'm trying to make textured quads in XNA but it ends up funny. Here's my code. public Quad(Vector3 origin, Color color, Vector3 up, float width, float height) { Vertices = new VertexPositionColorTexture[4]; Indices = new int[6]; Origin = origin; this.color = color; Up = up; // Calculate the quad corners Left = Vector3.Left; UpperLeft = (Up * height / 2) + (Left * width / 2) + origin; UpperRight = UpperLeft + Vector3.Right * width; LowerLeft = UpperLeft + Vector3.Down * height; LowerRight = UpperRight + Vector3.Down * height; FillVertices(); } private void FillVertices() { // Fill in texture coordinates to display full texture // on quad Vector2 textureUpperLeft = new Vector2(0.0f, 0.0f); Vector2 textureUpperRight = new Vector2(1.0f, 0.0f); Vector2 textureLowerLeft = new Vector2(0.0f, 1.0f); Vector2 textureLowerRight = new Vector2(1.0f, 1.0f); for (int i = 0; i < Vertices.Length; i++) { Vertices.Color = color; } // Set the position and texture coordinate for each // vertex Vertices[0].Position = LowerLeft; Vertices[0].TextureCoordinate = textureLowerLeft; Vertices[1].Position = UpperLeft; Vertices[1].TextureCoordinate = textureUpperLeft; Vertices[2].Position = LowerRight; Vertices[2].TextureCoordinate = textureLowerRight; Vertices[3].Position = UpperRight; Vertices[3].TextureCoordinate = textureUpperRight; // Set the index buffer for each vertex, using // clockwise winding Indices[0] = 0; Indices[1] = 1; Indices[2] = 2; Indices[3] = 2; Indices[4] = 1; Indices[5] = 3; } Does anyone have any advice as to why my texture ends up looking slanted, repeated and funny and why it seems to be wider than it ought to.
  12. You would create a viewing matrix. When I did it there was a lot of matrix work but it was so simple when it did work. Basically, there are three coord, a local so that say a gun in a hand can be considered relative to the person, and other similiar things, then world, where you want it in the world (so this would be your normal quardinate system) and then you do a matrix to get it on screen. Basically when an object draws itself it draws itself on a normalized device I think it was called. I forget the exact order of operations but I can look it up. It's about 4 matrix multiplications. XNA probably has it all done internally for you though, I haven't done it with xna. look into spritebatch.begin. I think you set a viewing matrix there.
  13. Just create an image that is a power of two but don't draw the empty area on screen. Or will that not work for your situation?
  14. ELFanatic

    [.net] XNA content pipeline

    Thanks Troll. I'll look into it. Good to know I can do that. How would I go about adding textures without adding them into the solution? For the asset name, would I just put the filename path?
  15. I have a couple of questions dealing with the content pipeline. first, do I have to add a file to the solution to load the content into the content pipeline. I ask this because it seems like it isn't efficient if the game has hundreds or thousands of images to load into the game. But I don't know. Also, is there a way to bundle a lot of images together? Is it even standard practice to do so? It seems that when I add an existing item to the solution and then need to edit the item, again, say an image, I then need to add it again. Is there a way around this?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!