Jump to content
  • Advertisement

Dr.House

Member
  • Content Count

    16
  • Joined

  • Last visited

Everything posted by Dr.House

  1. This is a function of a small auto-screenshot program I did. It's in Win32 so you shouldn't have problems. Just modify the code so it only captures the region of your window. void TakeScreenShot(char* filename) { keybd_event(VK_SNAPSHOT, 0x45, KEYEVENTF_EXTENDEDKEY, 0); keybd_event(VK_SNAPSHOT, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); HBITMAP h; OpenClipboard(NULL); h = (HBITMAP)GetClipboardData(CF_BITMAP); CloseClipboard(); HDC hdc = NULL; FILE*fp=NULL; LPVOID pBuf=NULL; BITMAPINFO bmpInfo; BITMAPFILEHEADER bmpFileHeader; do { hdc=GetDC(NULL); ZeroMemory(&bmpInfo,sizeof(BITMAPINFO)); bmpInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER); GetDIBits(hdc,h,0,0,NULL,&bmpInfo,DIB_RGB_COLORS); if(bmpInfo.bmiHeader.biSizeImage<=0) { bmpInfo.bmiHeader.biSizeImage=bmpInfo.bmiHeader.biWidth*abs(bmpInfo.bmiHeader.biHeight)*(bmpInfo.bmiHeader.biBitCount+7)/8; } if((pBuf = malloc(bmpInfo.bmiHeader.biSizeImage))==NULL) { MessageBox( NULL, "Unable to Allocate Bitmap Memory", "Error", MB_OK|MB_ICONERROR); break; } bmpInfo.bmiHeader.biCompression=BI_RGB; GetDIBits(hdc,h,0,bmpInfo.bmiHeader.biHeight,pBuf, &bmpInfo, DIB_RGB_COLORS); if((fp = fopen(filename,"wb"))==NULL) { MessageBox( NULL, "Unable to Create Bitmap File", "Error", MB_OK|MB_ICONERROR); break; } bmpFileHeader.bfReserved1=0; bmpFileHeader.bfReserved2=0; bmpFileHeader.bfSize=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)+bmpInfo.bmiHeader.biSizeImage; bmpFileHeader.bfType='MB'; bmpFileHeader.bfOffBits=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER); fwrite(&bmpFileHeader,sizeof(BITMAPFILEHEADER),1,fp); fwrite(&bmpInfo.bmiHeader,sizeof(BITMAPINFOHEADER),1,fp); fwrite(pBuf,bmpInfo.bmiHeader.biSizeImage,1,fp); }while(false); if(hdc)ReleaseDC(NULL,hdc); if(pBuf) free(pBuf); if(fp)fclose(fp); }
  2. Dr.House

    8-Bit Textures

    http://en.wikipedia.org/wiki/Netpbm_format http://netpbm.sourceforge.net/doc/ppm.html
  3. Does Bitbucket have free private hosting? Because all free code hosting webs I know are for Open Source.
  4. Dr.House

    Interactive Menu

    Wow, at the end it wasn't too hard. In like half an hour of work I got it finnished
  5. Dr.House

    Interactive Menu

    I have been thinking about making the menu of my game(game engine by the moment) to be interactive. I mean, it would have the buttons like any other game, but in the background I was thinking about a scene with some objects that the player can move, and like my engine has advanced Physics, they could play a bit in the menu. Another possibility is to make the menu a level itself. I mean, my game is a 2D platformer, so the menu could be some kind of level, like Braid's house, where every room represents a chapter, and you start them by opening the door. Another possibility would be having static buttons, and video in the background or an animated menu. Do you think it's useful? or do you instead prefer a static menu?
  6. I'm making a 2D platformer game, but by now I have only the engine, which is what I'm focosing on. Well, today I decided to improve ti with some "cool" post-process effects, and one of the most important and basic effect I want is to have dynamic lights. I've managed to raytrace them, and also to apply a "lighting texture" to the ray, but it produces a hard shadow. So I want to ask if someone knows how to make soft shadows (a.k.a. penumbra shadows). Or some project which uses it, or an engine (2D, XNA 4.0) which has it. Also, I was thinking what could make the game more dynamic, more beautiful, and I remembered what whas one of the best thinks Frosbite 2 has[size="1"]*, Radiosity. Seeing some examples of games with/out it, I reallised it would be great to have it. Well, I have some idea of how I could do it, but if someone knows if it can be done and/or how I would greatly appreciate it. Thanks in advance. [size="1"]*I know more engines have it and that Frosbite 1 also had it, but as good.
  7. Don't forget about Left4Dead and Left4Dead 2.
  8. Dr.House

    Interactive Menu

    I will make games!!! ...some day
  9. Dr.House

    Interactive Menu

    Thanks for the advice. Under other circumstances I would do that, but I'm making a engine for the moment, not a game. So, I want to have all ready for when I decide to make a game myself, or in the case I take part of a project.
  • 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!