Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

248 Neutral

About the_moo

  • Rank
  1. Matias Goldberg, thanks so much! I had thought about it being an external file issue but others were loading as they should so that couldn't be the problem. I had actually tried to fix the problem that it turned out to be (show boolean was being set to "true" by MSVC by the looks of it) but in a different way that wasn't targeting the real problem but a break off of it. Never knew Microsoft would do something like that - really doesn't seem to make sense. Anyway, thanks Matias, I now know to be more careful with my initializing and look out for irregularities caused by MSVC "fixing" my problems. Also, thank you all for the insanely quick replies - they are much appreciated! Jonathan
  2. Hi all, It's been a long while since I've been here but I'm in desperate need right now. I'm working on a game at the moment and all has been going well, but now I've hit a problem: For some reason, when I run my program from Visual C++ 2005 Express everything works normally as I intend it to. However, when it gets run as you normally would from explorer, there's one thing not being drawn. Everything else works, just one type of object won't draw to the window. Now I believe this is a matter of settings in Visual C++, but another program using the exact same functions and exact same files to draw with works in both cases... I really don't know what is happening and it's beginning to get frustrating because as far as I can tell it can't be a logic/math error since it works in one case and with no changes not in another. I appreciate any suggestions at all on how to fix this, Jonathan [Edited by - the_moo on May 22, 2008 10:21:51 AM]
  3. Hi all, It's been a long time since I've posted anything on GD and I've spent equally as long working on a few side projects instead of games. This is my latest (and admittedly, smallest) project this year, but I am quite happy with myself - I found out I had a lot of skill that I didn't know about before (Windows handles and technical things like that). The program is called the "Link Bar". That screenshot is how my bar looks at the moment. It is similar to ObjectDock if you've heard of it. I really made this for myself so there are some parts that are quite customizable and some that aren't (for instance, the size of icons is set). I decided to make it and stop using ObjectDock because: 1. I am always (for some reason) up for make tool-type programs; 2. ObjectDock had a nasty effect on DirectX applications. Before using it, my game (that I am currently working on) would run at 1700 fps windowed, but after I open ObjectDock that would drop right down to 110 fps and would never improve again until I restart my computer (hence why I say this is for DirectX developers). Also, DVD movies wouldn't work through PowerDVD (visual was just black) and I couldn't see video from my recording device. So, for those reasons I created the Link Bar. To add a link to the bar, you just have to drag it onto the bar and it'll update and show it as the last (right-most) link. Each link has it's own description that you can modify whenever you like. The "sections" divided by "separators" can be named individually to sort links into groups like "Folders" or "Games", and those names can be shown or hidden to suit. Links can be grouped by file extension to reduce the space the bar takes up, or to fit more on the bar. Moving over grouped files shows a list of all group links, and the group can be named just like any other link. You can also select which extensions to group - usually .exe files will occupy most of the links on the bar, so grouping them would detract from the usefulness of it. However, grouping playlists in one link and project files are just a few uses I thought of that keeps things neat and in one place. You can tell it to run on startup and it can be hidden when not being used, so that it doesn't get in the way. Unfortunately it doesn't have any support for command line arguments attributed to links (like control panel/my computer/network connections shortcuts), but this didn't seem necessary and still doesn't. Shortcuts manually created (like those for programs on the start menu and desktop) however have their target extracted so that they are no longer needed. As far as I'm aware this doesn't have any bugs that cause it to crash, and I'm pretty certain there aren't any bad glitches that render it impossible to use. If you'd like to give it a go (I've rambled so much now...), here's the link: Link Bar.zip If you like it or find something wrong with it, please feel free to post a comment; I like hearing what people think and why [wink]! Jonathan
  4. hey, danorux is right, just use a bool to record when it is down/up. while you hold a key down, it sends WM_KEYDOWN messages at a certain interval (set in BIOS or registry i think...) like 5 times a second (just think about a word processor how when you hold a key it repeats until you let go). this means when relying on WM_KEYDOWN you will get continuous responses while the key is down, hence why you would use a bool that is set (true) on the first message and unset(false) when it stops receiving the WM_KEYDOWN message for space bar. hope that clears it up for you,
  5. hey everyone, i have a feeling the line in port on my motherboard isn't working properly but before running out to do something about it (like buy an actual sound card...) i just wanted to get another opinion (or more [wink]). ive got a device that is accepting rca stereo cables (so red and white (right and left) ) and it outputs it through an audio jack (like with headphones/pc stereo speakers). now ive got this plugged into my line in on my motherboard and up until 2 days ago it seemed to be working fine (recordings from days further back have stereo sound), however, now i can only hear sound from the right speaker... i've tried plugging it to the microphone input on my pc to test whether it was the device not working properly, but both rca cables get sound through from both left and right inputs on the device... so i'm thinking that something's not right with my line in connection or something on the motherboard isnt working right, but either way i think i should just get a sound card and use it instead. just wanted to know what you guys think; any suggestions? thanks for any input,
  6. yeah sorry about that everyone... i realised that (from Oluseyi) but it just seems that the compiler with VC++ is a fair bit more strict than mingw and my usage of strings in my then current (and working) code wasn't up to scratch, even though it did compile (so yeah there were just a couple of logic errors - i do mean only 2 or 3). sorry to be such a rat in my last post - i do appreciate all suggestions and they did help me to realise where the problem was (ie. not the headers - my code). i guess it was the asking of the exact code that got me to really look more thoroughly for the problem and i pushed all other thoughts aside...as valid as they were. thanks again for helping us out [smile]. i will definately be using vc++ and the debugger much more frequently now that i can use the ide so hopefully i won't have to come back here and winge as often [wink]. thanks again everyone who posted,
  7. thanks for actually paying attention jpetrie: i've been trying out the debugger since you asked for code where the errors occur and i've found it much more useful than others i've tried to use... bottom line: i've now got most of it working (minus a few bugs with memory when releasing)! thanks for your help (sorry i didn't try it earlier - not much successful experience using debuggers till this point so was sceptical...), thanks again,
  8. hey all, ok i got all the problems with errors out of the way while i'm trying to compile my game with visual c++ (trying to move from dev c++) and now it is crashing during runtime... the only differences are the compilers and 3 include files. i've changed 2 headers and added 1 to remove compile time errors: original (dev-c++/mingw): #include <string.h> #include <list.h> changed (visual c++): #include <algorithm> #include <string> #include <list> now everything compiles fine but like i said i get runtime errors based around stuff in the no extension incude files... now, i realise that the includes for dev c++ are slightly different to begin with and they aren't the same as the ones i'm using for vc++, but if all the same functions and uses are compiling correctly, why are there runtime errors when there used to be none? its really baffling me because i thought i would now be able to use vc++ as my primary ide since its compiling but i still can't... any ideas/suggestions about how to get this working would be greatly appreciated. thanks,
  9. hey all, i've just set up visual c++ express and am trying to convert my current dev c++ project to a vc++ project but am having a heap of trouble compiling, so i've got a few questions: what file will vc++ compile first? how do you set file compile order? how does the #including work? (seriously, it seems way different to devc++ - it looks like it only keeps the definitions for the file that includes it... not for all the following code...) and finally, is all of this related and what practice should i use to solve the problem? sorry to pose so many questions but it really has me stumped; i mean, i'm trying to move to a noticably cleaner and easier coding IDE but it just isn't making it all that easy! thanks for any help,
  10. cool thanks! that was what i thought from what i read but nothing actually told me exactly - thanks!
  11. hey all, just a quicky this one: i have a base class "BaseObject" which i have derived others from - "MeshInstance" and "SpriteInstance". if i have two pointers to the same object: BaseObject *ptrbase; //imagine pointer is pointing to something (i.e. not NULL) MeshInstance *ptrmesh = ptrbase; //now both point to the same thing what happens if i do: delete ptrbase; ?? i was just wondering if this removes all memory including that which is occupied by members in MeshInstance since it is using the BaseObject pointer rather than if i had done delete ptrmesh; ... i just thought about it and wasn't sure (plus couldn't find the answer anywhere). thanks for any info,
  12. the_moo

    [mdx] Fading out meshes

    i believe i once had a problem similar to this... the thing is, directx mesh objects dont come with a colour variable in their vertex definition. this means you need to create a FVF with a value for colour and assign it to all loaded meshes. now while this may seem like a fair bit of work just to get a colour tinge on your meshes, its worth it [wink]. first off you need to declare the FVF you're going to use: const DWORD D3DFVF_VERTEX = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1; or something to that effect. in case you're not familiar, D3DFVF_XYZ means the structure your vertices will use contains x, y and z values (positions...), D3DFVF_DIFFUSE is the one that specifies a colour value and D3DFVF_TEX1 gives room for 1 set of texture coordinates. next you need a struct that will be used for each vertex's information: typedef struct CUSTOMVERTEX { float x, y, z; DWORD colour; float tu, tv; }; this has variables corresponding to the FVF that was specified before (position, colour then texture coordinates). so far so good, eh? now comes the tricky part - like i said before you need to tell every mesh object to use this format (D3DFVF_VERTEX) so that you can give colour to them. im going to assume you use D3DXLoadMeshFromX or something similar to load meshes and to get their pointers. here's how i went about applying this FVF: LPD3DXMESH tempmesh = NULL; LPD3DXMESH finalmesh = NULL; LPDIRECT3DDEVICE9 pd3ddev; //initialised device D3DXLoadMeshFromX(filename,D3DXMESH_SYSTEMMEM,pd3ddev,NULL,&matbuff,NULL,&num_mats,&tempmesh); tempmesh->CloneMeshFVF(D3DXMESH_SYSTEMMEM,D3DFVF_VERTEX,pd3ddev,&finalmesh); this takes the loaded mesh (tempmesh) and "clones" it but with the FVF supplied - D3DFVF_VERTEX - then it outputs a pointer to a new mesh (finalmesh). now the mesh thats loaded will have a colour variable in its vertex definition. to use this you need to lock the vertex buffer for the mesh and manually change all colour values for each vertex: CUSTOMVERTEX *verts = NULL; colour = D3DCOLOR_ARGB(alpha,red,green,blue); mesh->LockVertexBuffer(0,(void**)&verts); for (int i = 0; i < mesh->GetNumVertices(); ++i) verts.colour = colour; mesh->UnlockVertexBuffer(); this assigns the value "colour" to all vertices in the mesh "mesh". now when you render your mesh it should be with the colour value that you specify. this means that if you have textures, the colour will be applied over the top; so for no colour change to be applied, make the "colour" value = ARGB(255,255,255,255) or white. as for your question, if you want transparency in percentage youd do something like this: colour = D3DCOLOR_ARGB(alpha/100.0*255,255,255,255); where "alpha" is a value between 0 and 100 representing a percent of visibility (0% meaning totally transparent). hope that all helps! [smile] [Edited by - the_moo on May 23, 2006 8:40:30 PM]
  13. i believe you can do that just by creating a blank file with the name: "your executable filename".manifest so for example if your executable is called "program.exe" you would create the file "program.exe.manifest" i seem to remember doing this a little while ago and it worked fine... hope that helps!
  14. thanks Sharlin and superpig [smile]. i must confess i didn't realise that functions could also be templated. i've used a mix of that and typeid to work out the problem. thanks again for all the help,
  15. hey again, just a quick one this time: i've been looking around and haven't been able to discover whether there is a way to pass type names as parameters to functions and then use them (say in type checking or template-class-instance creation). something along the lines of: void MyFunc (type type_var); and then using "type_var" to assign things like so: temp_class<type_var> temp_obj; like i said i've looked around but haven't found a way (if there is one) that i can do this sort of type parameter passing. thanks for any help! [Edited by - the_moo on May 15, 2006 3:47:31 AM]
  • 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!