Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

133 Neutral

About BinaryStylus

  • Rank
  1. BinaryStylus

    ToolBars With VC++ [ FIXED ]

    Yeah - I'm really sorry - This could serve as a lesson :) Basically - I have a big data structure - that is where all the HWNDs for my windows. When I CreateWindowEx the result goes into this repository. Well I was trying to create the Toolbar with it's parent selected from the repository - Except at this point the HWND hasn't been saved there - 'Cause WM_CREATE happens before CreateWindowEx returns - Hence it happens before the window's handle gets saved. My Toolbar was being built with a NULL parent Handle - And I can't belive its taken my 48 Hours to realise that :'( Thanks To everyone
  2. BinaryStylus

    ToolBars With VC++ [ FIXED ]

    It just doesn't seem to work - I am just getting this error: 1406 - Cannot create a top-level child window. No Matter what I try - I can't force this thing to co-operate. I've even tried to create this tool bar with the assumption that it has to sit under main window. I don't know! LOL - Common controls seem to be - well . . . Does anyone use em?
  3. Hi There - Using VS2003 and VC++ .NET - I've not done too much window controls programming - mainly just edit boxes and Dialogs etc. Decided to use a Toolbar to jazz things up a bit - Primarily I needed a way to show the user if the application was in a particular "State" or not - A toolbar, I thought, would let me do this - Because I could leave the button depressed to show the user that the state was Active. OK - Well I can't get tool bars to work at all - Best I've gotten is the system to report error: 1406 - Cannot create a top-level child window. Which is interesting because MSDN states "A top-level window is any window that is not a child window" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_styles32.asp) Has anyone got any reference material for this - MSDN keeps talking about using CreateToolbarEx but then states that this is obsolete. I've gotten the commctrl.h header included and comctl32.lib in the linker - I call InitCommonControlsEx and that returns OK - But then when I do something like hwndTB = CreateWindowEx(0, TOOLBARCLASSNAME, (LPSTR) NULL, WS_CHILD | TOOLTIPS | CCS_ADJUSTABLE, 0, 0, 0, 0, hwndParent, (HMENU) ID_TOOLBAR, hInst, NULL); It gives me Error 1406 again. I gather that the Resource tools for making Toolbars relate to MFC - 'cause they don't seem to help at all if you're just using the API. I've wasted a whole weekend on this - and am just going to implement my own toolbar class with button controls - Which I can probably do in a short time - I just can't believe that Toolbars (Which are pretty significant for MS Windows) are this un-intuitive! Anyone got any demo code or anything that puts a tool bar up on screen? Cheers everyone! [Edited by - BinaryStylus on August 27, 2006 3:29:06 PM]
  4. Hey Dude! It looks like your code takes an XY and Z and makes a translation Matrix 1 0 0 0 0 1 0 0 0 0 1 0 X Y Z 1 and then Multiplies that with your Matrix (A). Now I guess (A) is an orthogonal rotation matrix with possibly a translation Component and will be of the order. a b c 0 d e f 0 g h i 0 X Y Z 1 If the matrix (A) does not contain a translation before you multiply it - then all you need to do is place X in the X position in your matrix (A), Y in the Y pos, etc. Otherwise, (If your Matrix (A) could contain translation data before the multiplication), all you need to do is Add your X to the existing X in your matrix (A). There are HUGE optomisations that can be made if you know that your matrix will contain only Orthogonal rotation + Translation components. because basically you are only then dealing with a 3 X 3 matrix with a vector (Translation component) tagged onto it. But Certainly - because you build an identity matrix with just a translation in your function - there will be no problem with going straight to a solution with pure addition.
  5. BinaryStylus

    Question about LOD's

    Hi - I've got that book and liked it a lot. The Roam seemed quite good if you had computer (psudo random and on-the-fly) generated terrain. But I conceed your point that the tiles are probably a better solution - being tiles they lend themselves to generated terrain also. Here's the deal though. You've got your terrain. It's nice and it has a LOD running and you're even running physics between the terrain and the other Models. Its just that if the other models are running their own LOD - the two might/could look wrong together. I'm taking about those slightly naff moments when any illusion is broken - like where the models look to be in one graphical style and the terrain is another. And I suppose Roam breaks down there too. At least with the tiled solution it will be easier to link the terrain tile's LOD change distances with that of the models. Ahhh - what do I know. Besides the scale is different. And I guess popping would start to become an issue if you slaved the terrain LOD to the models. One thing I was playing with was like a terrain "detail map" to add extra vertex detail - (but nothing significant enough to be considered by the physics) - to the terrain at close distances - to make the stages in detail of the Models match up with those of the terrain. OK - I'll be quiet now :(
  6. BinaryStylus

    Question about LOD's

    Hi, I'm comming up to the point where I am interested in doing LOD for my models. And I am considering having a value with each vertex that is a weighting - 0 is always shown - 1,2,3,4 etc are only shown at closer and closer distances. Using an index buffer makes things easier - as it lets me keep all the level 0 Vertices at the front of the vertex buffer and all level 1 after, etc - so that if the distance is such that I only need up to level 3 data - i only send the first few tens of data - as opposed to the whole lot. Additionally I don't need to actually save the Weighting value in the vertex itself - because if the vertex is in a certain range inside the vertex buffer - it is implicitly a certain value. And the same thing can be done with the index buffer - although it is much quiker and efficent for the model editor to make a new index buffer for each level of detail - than work them out on the fly. Hey just some Ideas I'm playing with for what I'm working on. Tim!
  7. BinaryStylus

    Does anyone find it hard to keep going?

    Yeah - Its good to know other people get like this too. I was stressing that I lacked dedication :P Anyway - I done some stuff on paper, I've thought about it, I have a testing strategy, and I've got a long list of small jobs - So I can just start crossing things off my list. Thanks all!
  8. BinaryStylus

    Does anyone find it hard to keep going?

    Yeah - I'm getting back into it again now - Don't know about playing Video games tho :) Last one I did was WOW and I even started booking time off work to coincide with Guild raids. I should have had therapy (Sooner). I want to start playing some indie games - thats the best idea someone's given me in ages. Cheers
  9. BinaryStylus

    Laptop suggestions

    Dude - Try This Hope it helps a little
  10. Have a major burnout problem. I work like stink - obsesivly for 30+ hours a week on my little projects for a couple of months - Really start to learn stuff and then make progress - and then all of a sudden its really hard to focus anymore. I've now sort of wasted 3 weeks - havn't lost any enthusiasm - but just can't seem to get in deep again. Hmmm. . . Or maybe its the Summer :(
  11. BinaryStylus

    Scariest game?

    Action Adventure / Survival Horror - are my favourites - Most scary IMHO is System Shock 2 and Silent Hill 3 - I also thought that Doom 3 was pretty scary. Love this thread
  12. BinaryStylus

    New To Programming

    If you want a really cool book to get you going with C++ FAST then please try Mark Walmsley's book "Programming in C++" its only £6 from Amazon and it is really nice. It'll get you up to speed very quickly. Well its the book I learn't from, Hope this helps
  13. BinaryStylus

    New To Programming

    Yeah - I agree with Stecal849 - You could really put yourself off programming if you make your learning curve too steep. You can do cool stuff with almost anything - VBA and Access is all you need to make a really rubbish space invaders game - :) - I know I got bored at work. Keep it up
  14. BinaryStylus

    Access Violation Reading 0xffffff [Fixed]

    Just found this in the MSDN library: To create an array whose base is properly aligned, use _aligned_malloc, or write your own allocator. Note that normal allocators, such as malloc, C++ operator new, and the Win32 allocators return memory that will most likely not be sufficiently aligned for __declspec(align(#)) structures or arrays of structures. So I suppose that this is it :( // Edit // ======== My solution and it works thus far is to define a macro: #define __Align(iAlignment) void * operator new(size_t s){return(_aligned_malloc(s,iAlignment));} void operator delete(void *p){_aligned_free(p);} void * operator new[](size_t s){return(_aligned_malloc(s,iAlignment));} void operator delete[](void *p){_aligned_free(p);} And include it in any class/structure that uses __m128 data - Typically I use 16 in the iAlignment parameter. This is cool because the constructors for the classes still get called - and operator new is automatically declared static. In complicated classes I set up a structure/class for thier data and have all of the __m128 stuff moved into that struct/class - and just give the main class a pointer to the data class. The data class has __Align(16) in it - and the main class' constructor and destructor have calls to new and delete (respectivly) to make the data pointers live. Additionally in the data class I make sure that any __m128 stuff is declared at the top and leave any int/double/float etc at the bottom - so the __m128 stuff is shoved against the 16 byte boundary. // ------------------ Its not really a "Fix" or a one-size-fits-all solution but it does seem to be a way for dealing with data alignment. Microsoft state that thier C++ new and Malloc aren't strict enough for __declspec(align(16)) - and they suggest using _aligned_malloc - Stroustrup also says you're asking for trouble using malloc instead of new for dynamic class creation - So this is what comes out. Additionally I placed my __Align macro in a non-trivial class that had __m128 data - and the problem still occured - Even after I moved the __m128 data to the top of the class. That class had several non-trivial data types - D3DPRESENT_PARAMETERS for example declared in it - and I think that maybe that is just too much for new when it is trying to work out (with alignment) how big the size_t value should be and what the offsets for the data are. [Edited by - BinaryStylus on April 15, 2006 8:54:59 AM]
  15. BinaryStylus

    Access Violation Reading 0xffffff [Fixed]

    TY - Thats nice. I'm working on a memory manager now - The intel article suggests that the problem occurs when I use New - which is a fair point - as the temporary variables work fine. It seems that I will just need to write an overloaded New operator for every class that contains an __m128 variable. Apparently _aligned_malloc is the way to go. Cheers
  • 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!