Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

108 Neutral

About scope

  • Rank
  1. You erase the object from the container and recieve an iterator to the next object in the list. Then at the end of your loop you increase the iterator again, which is wrong. You should do only one increment. To correct this, your loop could be written like this for example: for(list<PlayerPiece*>::iterator ppi = serverGame.piecesInPlay.begin(); ppi != serverGame.piecesInPlay.end();) { if((*ppi)->isDead()) { ppi = serverGame.piecesInPlay.erase( ppi ); } else { ppi++; } }
  2. scope

    Why does this leak???

    Quote:Original post by Tipotas688 no what's that? There's a cool website for stuff like this. It's called "Google.com". You just enter a term like "smart pointers" and it will list a lot of relevant websites! Really cool stuff.
  3. scope

    passing enums in funtions ??

    class A { public: enum abc { a, b, c }; }; class B { A::abc s; void use_abc(A::abc e) { s = e; e = A::a; } };
  4. scope

    Batching With Vertex Buffer

    Quote:Original post by unbird Hmmm, this is rather for 3D meshes. Oh yeah, i didn't see the "sprite" thing. Just saw "texture atlas" and first reaction was Hoppe and D3D UVAtlas :)
  5. scope

    Batching With Vertex Buffer

    Quote:Original post by justin12343 So, how do I make a texture atlas? you could start by reading the publications of Hugues Hoppe, or save a few brain cells and use the D3D9 UV Atlas API.
  6. scope

    render 1 pixel?

    Woops, seems like i mixed up my browser tabs on the previous post. Ok seems like reusing another buffer is the way to go. I just wanted to avoid this for coordination and encapsulation reasons etc. Thanks for your insights :) If anyone has another cool idea, i'm eager to hear it.
  7. scope

    render 1 pixel?

    post edited away by accident, browser tab chaos. [Edited by - scope on September 23, 2010 11:13:37 AM]
  8. scope

    render 1 pixel?

    Quote:Original post by Evil Steve EDIT: Actually, that might not be so great, since the pixel shader will be run for all the culled pixels too... This is no problem since i only have to re-render the geometry when the camera changes (which is not too often during painting and picking). But i was wondering how i can use a 1x1 render target (or whatever is possible) and draw only that specific area under the cursor to it.
  9. scope

    render 1 pixel?

    Quote:Original post by SiS-Shadowman That depends. If you want to render one pixel in any given color (and not affect the rest of the screen) then create a quad with vertex coordinates that only covers one pixel of your screen. Oh, i see, we have a little Mißverständnis here ;-) I actually want to read back a pixel from the screen to the cpu in opposite of drawing one to the screen. The pixel i want to read back would be the result from a pixel shader which is executed on the geometry.
  10. scope

    render 1 pixel?

    The API is DX9. Yes, it's used during editing only. I want to run the scene through a pixel shader and read back the color under the mouse cursor. It's used for mesh picking but also texture painting. It's not really performance critical, but consumes an entire fullscreen buffer (which is created on mouse down and released on mouse up). I guess i could re-use my normal buffer or something but that feels kind of wrong since i might need it at a later point. I was looking for some lightweight solution.
  11. scope

    render 1 pixel?

    Hi SiS-Shadowman, thanks for the reply. I'm not sure if i got that right. The quad would have to be textured with the scene buffer (position, uv's or whatever i want to pick)? Another method came to my mind: - use stretch rect to transfer the pixel to small buffer. But that would require to render to a fullscreen target as well.
  12. Hi, I want to render only one pixel of the screen (or whatever is the smallest render target size), the one below the mouse cursor (for picking). Unfortunately i'm not sure how to set this up correctly. Setting up the render target is no problem ;-) How about view matrix, view port etc.? Anyone know off the top of the head? edit: maybe i could abuse one of my fullscreen render targets for this, but how can i transfer only single pixel from the render target to the cpu?
  13. I'll never get how people write entire programs and THEN try to compile them for the first time.
  14. scope

    Basic Octree in Mesh .x

    Well, writing an octree is quite advanced. To me the best way to approach something new is to do it step by step. And to make sure that each step works perfectly before you proceed to the next step. With each step you will consolidate your knowledge and make the next steps easier to understand. for example: 1) load the mesh. render it. make sure it renders correctly with all materials. write all this on your own. 2) learn about implementing trees in c++ if you haven't already. trees can easily be built with a structure like this: struct node { node* children[2]; // 2 for binary tree, 4 for quadtree, 8 for octree etc. }; 3) compute the bounding box of the mesh. render the bounding box. make sure it looks correct. 4) split the bounding box into 8 child boxes of equal size. render them. make sure they look correct. 5) incorporate the boxes into your tree structure so you can recursively traverse them. 6) by now you should know how to proceed on your own good luck
  15. scope

    Basic Octree in Mesh .x

    looks like you copy & paste a whole lot of code without understanding what it does. maybe you should actually learn directx and c++. it will get you to your destination much quicker.
  • 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!