Jump to content
  • Advertisement

VprMatrix89

Member
  • Content Count

    160
  • Joined

  • Last visited

Community Reputation

100 Neutral

About VprMatrix89

  • Rank
    Member
  1. So, earlier I ran into this problem with structs. I started using many of them and suddenly I had two include files than needed each-others structs. However, when I include one in the .cpp the other was blocked from including it later because of the #ifndef. Example: ui.cpp #include ui.h ui.h #ifndef _uih_ #define _uih_ #include main.h //code here #endif main.h #include file1.h #include file2.h... ect. Main.h had linear dependency meaning no file.h had a dependent listed above it. Should I take out the #ifndef and select the includes manually? Although I like the idea of linear dependency it leaves out flexibility. If a more depth example is needed I can provide.
  2. return HeapAlloc(_crtheap, 0, size ? size : 1); I get an exception on this line in malloc.c I'm using vectors extensively and am wondering, if you simply use too many vectors will there be problems? It doesn't seem to matter which type I use, when I use push_back it gives me this error on the nth vector I use.
  3. VprMatrix89

    Scope of New operator

    Tbh I thought new was only in c++. Why do you want to know? I'm probably doing something that's been done 100 times (unfortunately). Its far from finished but I said before all it does now is act as a single buffer with dedicated sections. This particular question was to find out if I could use a Template to create new instances of memory that aren't being overwritten randomly, I didn't know the new operator worked so diligently.
  4. Is this true: in the scope of a function the new operator is forgotten after the function ends? I'm trying to find a way to allocate permanent memory that isn't initiated in the code in any way. (ie no pointers or vectors ). I want to create a permanent vector from nothing, is this possible ? In essence what I'm trying to do is register a type but use it in a vector container.. But vectors seem to need a pre-defined type.
  5. VprMatrix89

    Std::Vector question

    Then I'm still confused as to the point of the iterator, as its just a pointer? If a normal pointer would suffice, whats the use?
  6. So, earlier I was working with these and I know that the vector probably allocates memory with the 'new' operator. My question is this : Does the std::vector guarantee that memory is contiguous? The only way I can think this is possible is to copy the entire contents on each action ( be it inserting extending ect.). Of course, my strong assumption is that the vector does not do this, and that is the necessity of the iterator ?
  7. VprMatrix89

    Void Pointers question

    Templates did it. Thanks for help.
  8. VprMatrix89

    Void Pointers question

    Quote:Original post by SiCrane There's no such thing as a void function. Do you mean a function with a void return type? If so, then you can't return anything from it, not even a void pointer. Of course, you also failed to post code or bring muffins, so it's hard to help you. Yes it is void*. The code is just full or syntax bugs not worth showing. I'm starting to think this would be easier typecasting a char* pointer and using it as basic strider. If I don't I will have to write a cast for each type when I could just get a stride and move it in bytes. Or templates, which I don't understand why they don't work in a header/source file. Just seems like a distraction.
  9. VprMatrix89

    Void Pointers question

    I get the arithmetic now, it didn't know the size of bytes with no cast. Does the void function have to return a void pointer?, I'd much rather do arithmetic within the function. Otherwise I will also be writing to an address the amount to move the pointer. The 'high level goal' is just a simple macro. It puts like things together while trying to optimize memory(less fragments) among other directives I can give it. It will do this and interface with a global buffer of types..
  10. I tried to make a function that returns a void pointer, and I don't see why the program will not allow it. Why can't it just be type casted later to assume its use? Can this error be fixed? :: error C2036: 'void *' : unknown size And the only reason I do this is to avoid a function for each type.. While also avoiding templates if I can.
  11. Can anyone please point me in the right direction? I need something that can load any font (I dont care which format) to a texture. Or perhaps a font format that can be read like a texture - I'm not sure how they work. Thanks
  12. VprMatrix89

    manual uv in shader

    Why should the pixel shader crash because of this ? All im doing is manually changing the uv to 0,0. float2 tile_ = {0.0f,0.0f}; u = tile_.x; v = tile_.y; Out.Color = tex2D(Tex0, float2(u, v));
  13. VprMatrix89

    Need help with Pixel shader

    The only solution I thought of is to use a texture or something and use the original uv coords to detect which vertex is being drawn since apparently, you can't use an iteration variable in the shader. The only reason I think its possible is because I'm assuming that the verts are shaded in order from the VB. (left to right). I suppose it would be easier to just to add another UV to the vertex as has been mentioned. Thank you
  14. As far as my understanding goes theres a couple ways to upload data to the shader. 1: The constant table, 2: fx files. I've tried to use the constant table before with little success :( I want to upload a float2 for an extra set of UVs, And I dont want to declare another UV in the FVF (if thats even possible). What is the best way to upload a float2 to the shader decoupled from the actual vertex? [Edited by - VprMatrix89 on March 27, 2009 9:24:28 PM]
  15. VprMatrix89

    GPU Generation

    I'm confused as to how exactly this is done. I'm reading a book that quotes "Parameters are always passed by value" in HLSL. Does that mean you cannot generate anything in shaders? If so, what do ppl mean by "GPU Generation"?
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!