• Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About m4ster

  • Rank
  1. older versions

    DirectX is just a dynamic set of dll's. When you use the DirectX headers, your application don't cares, which version of it is installed. It just loads the librarys on runtime, so your application uses the version installed on the computer you are running it. So it's not important, whether you use directx9 or 8. [Edited by - m4ster on January 14, 2007 12:44:56 PM]
  2. How do I learn the DirectX APIs?

    If it was just a wrapper library, it should be no problem to learn directx, because you should know the usual steps to create and use directx. You just have to find the fiting direct x function. Hence, read the documentation, as TFS_Waldo said. [lol]
  3. My First Post, My first Game!

    Enrico is right. I also used the RPG-Maker in former times, but it has not much in common with languages like C, Delphi or Java. So you have to decide, which language to use. Then you should buy at least one book focusing on the programming language. Then you can go on with your first game programming book and start with stuff like asteroids. [lol] [Edited by - m4ster on January 14, 2007 12:06:15 PM]
  4. Color Conversation SOLVED

    After a long time without finding the error I decided to rewrite the whole funtion. Hence I used this very good tutorial. [Edited by - m4ster on January 14, 2007 12:50:56 PM]
  5. Sprite Loader SOLVED

    Hey, I found the mistake by myself. It's pretty easy and very very very stupid [lol]. // Struktur vorbereiten DDSURFACEDESC2 ddsd; memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwWidth = sizeof(ddsd);// Has to be: ddsd.dwSize [Edited by - m4ster on January 14, 2007 12:24:27 PM]
  6. Sprite Loader SOLVED

    I don't lock both surfaces the same time, because I don't like it. I tryed to make clean and easy code and in my opinion locking 2 surfaces the same time seems to be too complex. [lol]
  7. Lock. vs Blt SOLVED

    After a long night I decided to take the Blt(and ColorFill) method. Not because of any speed reasons, just because it's simplyer to implement. I haven't to care about the extra memory pieces to make the surface a multiple of 2. EasilyConfused Yes, you are right, this is another very important point. Thank you. [Edited by - m4ster on January 14, 2007 12:50:29 PM]
  8. Hi all, I made a function that loads a Part of a Surface and stores it in a new Surface. But it don't work. The new created Surface is always full of black and some white pixels. NOTE: I use 8BPP Mode bool LoadSprite(LPDIRECTDRAWSURFACE7& rpDDSImage, LPDIRECTDRAWSURFACE7& rpDDSSprite, int nSpriteWidth, int nSpriteHeight, int nSpriteX, int nSpriteY) { // Struktur vorbereiten DDSURFACEDESC2 ddsd; memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwWidth = sizeof(ddsd); // Image locken if(rpDDSImage->Lock(NULL, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, NULL)) return(false); int nImageWidth = (int)ddsd.dwWidth; int nImageHeight = (int)ddsd.dwHeight; int nImagePitch = (int)ddsd.lPitch; int nStartX = nSpriteX*nSpriteWidth; int nStartY = nSpriteY*nSpriteHeight; BYTE* pbyImage = (BYTE*)ddsd.lpSurface; // Bild ist groß genug? if(nSpriteWidth*nSpriteX > nImageWidth || nSpriteHeight*nSpriteY > nImageHeight) { rpDDSImage->Unlock(NULL); return(false); } // Speicher für das Sprite bereitstellen BYTE* pbyTemp = new BYTE[nSpriteWidth*nSpriteHeight]; for(int nY=nStartY;nY<nSpriteHeight+nStartY; nY++) { for(int nX=nStartX;nX<nSpriteWidth+nStartX;nX++) { pbyTemp[nX + (nY * nSpriteWidth)] = pbyImage[nX + (nY * nImagePitch)]; } } // Image freigeben if(rpDDSImage->Unlock(NULL)) return(false); // Struktur vorbereiten memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); // Sprite Surface locken if(rpDDSSprite->Lock(NULL, &ddsd, DDLOCK_WAIT |DDLOCK_SURFACEMEMORYPTR, NULL)) return(false); int nSpritePitch = (int)ddsd.lPitch; BYTE* pbySprite = (BYTE*)ddsd.lpSurface; // Daten umkopieren for(int nY=0;nY<nSpriteHeight; nY++) { for(int nX=0;nX<nSpriteWidth;nX++) { pbySprite[nX + (nY * nSpritePitch)] = pbyTemp[nX + (nY * nSpriteWidth)]; } } // Surface freigeben if(rpDDSSprite->Unlock(NULL)) return(false); // Speicher freigeben delete pbyTemp; pbyTemp =NULL; return(true); }[/code] Please help, otherwise my project will never finish [tears] [Edited by - m4ster on January 14, 2007 12:42:07 PM]
  9. Lock. vs Blt SOLVED

    Hey, I mean in DirectDraw. I forget to write this, because I just worked with DirectDraw until now. But I think it is better to use the blitter, because you dont have to care about the pitch. [Edited by - m4ster on January 14, 2007 12:16:08 PM]
  10. What do you think is faster? Fill a Surface with black using a Color Blit or a Lock and setting the VRAM to 0? [Edited by - m4ster on January 14, 2007 12:43:00 PM]
  11. 2D Space Game Material SOLVED

    Hi Tony, First comes first - Thank you for your fast answer. I downloaded this graphics and I realy like them. Now I can go on designing my game. In love [inlove] [lol] [Edited by - m4ster on January 14, 2007 12:52:16 PM]
  12. Hi, I'm going to make a 2D Arcade like Space Shooter and I'am searching after some cool and free space images in 2D. I need a lot of space-ships, cool weapons, planets and other cool stuff. [Edited by - m4ster on January 14, 2007 12:43:23 PM]
  13. What is the point of Namespace?

    Hi, here's a very good article about how to use namespaces. It helped me a lot in understanding namespaces. [Edited by - m4ster on January 14, 2007 12:24:47 PM]
  14. Hey, actually I'm working on a kind of 2D Engine. It uses DirectDraw, but the user has not to care about that, because there are a lot of own structures. Before some time I made a list, which futures should be included, and now I want to ask you, whether I forgot sth. <BG>. INIT/RELEASE STUF -Window/Fullscreen Application -Color Depths ( 8, 16, 32 BPP) -Screensolution ( Every screensolution possible ) -number of backbuffer isnt limited IMAGE STUF -png and bmp support -load and draw images -image manager, so that the user only works with id's -image handling ( rotation and scaling ) -reload of bitmas DRAW STUFF -own font drawing system ( bitmap fonts and system fonts ) -color depth independent function calls -output of the pixelformat -line, rectangle and polygon support -clear the screen MISC. STUF -Log Manager -clippers, software and hardware -enumaeration of all video modes etc...
  15. What should I use NULL or 0

    I also think it is a good idea to use NULL for pointers. A NULL shows me a variable holding a address, a 0 shows me a variable holding a number. BTW 0 and NULL are realy the same, if there's a problem with your compiler just define a constant (like #define NULL 0) and you get along with your compiler <BG>. MFG Damien K.