Jump to content
  • Advertisement

Harryu

Member
  • Content Count

    152
  • Joined

  • Last visited

Community Reputation

174 Neutral

About Harryu

  • Rank
    Member
  1. Hi everyone, In my game, I want to play a video cutscene at certain times. I am currently using IVideoWindow to do this, and it works perfectly when the game is being played in a window - a new window with the video is created over the top of the game window (the same size), the video plays, the new window is destroyed, and program control returns to my game. Perfect. However, when I play the game fullscreen, I get some problems. First of all, I obviously don't want the video to play in a window any more - I want it to be fullscreen too. So, I have been using put_FullscreenMode(OATRUE) to set the window to play fullscreen. When it plays though, the screen turns black (as would be expected in preparation for the video), and in the top left corner, the video plays in 800x600 size (this is the size I set for the Direct3D device before setting fullscreen - I don't know if this is important though). Ideally, I would like the video to stretch to fit the whole screen. If this is not possible, it would be good to at least have it centered. But if I set the game to be windowed, and the video to be fullscreen, the video stretches to cover the whole screen (like I want it to). So that's one problem, here's my second: when the video finishes and the game is being played fullscreen (it doesn't matter whether the video is fullscreen or not - the same thing still happens), the game becomes minimized and I can't reopen it... Anyway, I'd really appreciate some help on this - it's driving me crazy! Thanks, Harry
  2. Harryu

    Fullscreen problems

    I use D3DSWAPEFFECT_FLIP for fullscreen, ...DISCARD for windowed.
  3. Hi, I have a loading screen for my game, where I initially render a faded-out sprite, and then, as the game loads, I render more and more of the full colour sprite. So I have: Clear screen (white) Render faded image Load some stuff Render 10% of coloured image over the top Load some more Render 20% of coloured image ... You get the idea Each time I render more of the coloured picture, I do the BeginScene and Begin (for the sprite) (but never clearing the screen). Now, this works perfectly in windowed mode (setting the window flag in the present_parameters structure to true), but when I use fullscreen (setting 'window' to false), on alternate 'colouring steps' (i.e. 20%, 40%, 60% - or 10%, 30% - I'm not sure which one) the background (usually white) turns black, along with the faded out image (or at least, whatever remains visible). Any ideas? Thanks in advance, Harry
  4. I've recently been playing around with a simple DirectX application, which lets the user view a 3D cube. The user can zoom in and out on the cube (the view changes, as opposed to the size of the cube), and spin it around. I've set up the world and view transformations, but I've run into some issues when I try to set up the projection transformation. Specifically, when I use the D3DXMatrixPerspectiveFovLH (or something like that) function, it all works fine, except the cube isn't really a cube (which I understand is normal for a Perspective, as opposed to orthogonal transformation). I just need to set the transformation at the beginning of the program, and I can zoom in and out, etc with no trouble. When I try to use D3DXMatrixOrthoLH (once again, I think that's it) however, while the cube is nice and 'cuby' (ie orthogonal), I can't zoom in or out. The only way I can make this work is to re-create the matrix every time the zoom factor changes, and modify the size of the view according to the zoom factor so I get a similar range of view to that I got with the Perspective projection. After this, it works. So my questions are: 1. Is there a way to set up an orthogonal projection transformation such that I don't have to re-create it every time the size of my viewport changes? 2. If no to (1), is there a way to find the size of the viewport from the view transformation matrix, or equivalently, find the size required to make an orthogonal projection transformation 'fit' with the view transformation?
  5. Harryu

    Couple o' Qs.

    For the key repeat problem, you could try the method I used for my Java game engine. Basically, I maintain an array (ArrayList, as it were) of all the keys that have been pressed, but not yet released. So every time there is a key press, I check to see if that key is in the list, and if it's not then I add it. If a key is released, I remove the key from my list. When you want to check a key state, you can just check the array. Hope that helps, Harry
  6. Ok, thanks for both the answers and the links. To answer the questions, a) C++, b) curiosity. That's all I really needed, and thanks for telling me it's not good practice to use them before I went off to find some unnecessary use for them in a game or something!
  7. Sorry about the vague subject, but I didn't really know how to say it. Basically, you know how there are functions like printf, which can take different numbers of arguments, ranging from 2 to (I don't know how many). I was wondering how (if it's possible) could you create a function like this. Thanks, Harry
  8. I'm in college atm, and it is the dawn of a new term. With this new term, comes a new unit of IT. Last term in IT, although we were told it was going to be an introduction to Java unit, we actually ended up spending a term learning Flash Actionscript. I didn't really like the sound of this, so I asked my teacher if I could just learn Java instead, and he said that was fine. So basically I spent the term learning the language, and subsequently writing a simple game engine, and several games, which I was assessed on. This coming term, we are meant to be continuing our work with Flash, and once again, I don't really want to do this. So my question is, does anybody have some ideas as to what I could spend a term of IT doing? I know C++, Python, BASIC, and to some extent Java, and have worked with the DirectX libraries. I was thinking I could either do more Java, and maybe have a look at the Micro Edition or something, work on the FPS I have been making in my own time w/ C++ and DirectX, but apart from that I don't really have any ideas. Suggestions anyone? P.S. I don't really know where to post this, as it isn't really a problem I'm having with development itself. So if it shouldn't be here, I'll be more than happy to delete it and post it somewhere else.
  9. I'm not sure whether or not animated GIFs work, but in my game, I saved each sprite in a non-animation-supportive format (bmp, png, jpg, etc...), and just had all the animations in the one picture. So say I had a 32x32 Pacman, with 2 animations, I would have a 64x32 bitmap, with the first 32x32 (0,0 - 32,32) taken up by the first animation, and the second 32x32 (32,0 - 64,32) taken up by the second. You can then load this image into your game (I created a seperate class to handle the sprites, which also took care of animation), and specify the width and height of the image you want to draw (in this case, 32x32). You can then figure out how many different animations there are (width of image / 32). Now, you can keep a variable with the current frame number (0 or 1), and every time you update the sprite, update this variable (don't let it go beyond 1, just reset it to 0). Alternatively, you could also set a frame delay, so the sprite only update every 5 frames, or 10 frames, or whatever you wanted. Then, when it comes to drawing the sprite, simply use one of Java's several different draw functions to only draw a specified area of the image to the screen, namely (32*framenumber,0 - 32*(framenumber+1),32). Also, to stop you from having to recreate all your GIFs, you may be able to use a program to seperate the frames, and then just save this as a normal, static image.
  10. Yep, that's perfect. Thanks for your help.
  11. Hi, Recently, I've found using the single bits of say, a long integer, is very useful for storing true/false, on/off, etc... information. For example, in the game I am making at the moment, the player has various 'states', such as moving, shooting, crouching, etc... I know that I can say: STATE_MOVE = 1; STATE_SHOOT = 2; STATE_CROUCH = 4; STATE_... = 8; etc..., and have them in powers of 2. Then you can use |= to set the different bits, then (I think) you can use ^= (XOR) to turn off the different bits. To check whether a bit is on you can use & comparitively. I was wondering though, is there a way you can say "set the nth bit of this variable to 0/1", and "is the nth bit of this variable 0/1?", without having to work in powers of 2. It isn't really a necessity for my project, but I'm just curious as to whether this is possible. Thanks, Harry
  12. Harryu

    would you recomend me to get this book?

    Hi, I've read Michael Morrison's (very good btw) book, and when I started I knew absolutely nothing about the Win API. Although the first few chapters were quite difficult to get through, I eventually got on top of it. So really, I think the short introduction to the Win API that comes "Beginning Game Programming" is sufficient, as even though it's only a very basic guide, you will gradually pick up new information throughout the book.
  13. I had a look on MSDN, and I couldn't see a function which would do that. Does anybody have either any other ideas, or a way to find the location of a bone/joint in a DX mesh?
  14. Thanks for the response zedz, but I'm not quite sure I understand what you mean. How would I 'attach' my flash polygon to his pivot? Or would I do something different altogether? Thanks
  • 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!