Show Posts
|
|
Pages: [1] 2 3 ... 22
|
|
2
|
Developer / Technical / Re: Creating a win32 window
|
on: May 08, 2013, 02:49:58 PM
|
I assume in SwapBuffers you're calling SwapBuffers(hdc)? Do you do this anywhere in the loop? MSG msg; while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { { TranslateMessage(&msg); DispatchMessage(&msg); } }
|
|
|
|
|
4
|
Developer / Technical / Re: Creating a win32 window
|
on: May 08, 2013, 07:51:14 AM
|
struct VideoProperties//todo multiple window support { uint x,y; uint w; ///< The width (in pixels) of the current display uint h; ///< The height (in pixels) of the current display uint bpp; ///< The Bits Per Pixel (NOT bytes) of the current display \warning IT IS NOT BYTES float aspect; ///< The Aspect Ratio of the current display (w/h) float inverseAspect; ///< Inverse of \a asoect (h/w) bool fullscreen; ///< Signifies whether the current display is fullscreen bool vsync; ///< Signifies whether the current display has V-Sync #ifdef USE_WIN HGLRC hrc; // Rendering context HDC hdc; // Device context HWND hwnd; // Window identifier HINSTANCE hInstance; #endif } videoProperties; int main(int argc,char **argv) { videoProperties.x=640; videoProperties.y=220; videoProperties.w=800; videoProperties.h=600; videoProperties.bpp=32; videoProperties.fullscreen=0; videoProperties.vsync=0; videoProperties.aspect=-1; videoProperties.inverseAspect=-1; vec2i originalSize(videoProperties.w,videoProperties.h); if(videoProperties.aspect==-1) videoProperties.aspect=(float)videoProperties.w/(float)videoProperties.h; if(videoProperties.inverseAspect==-1) videoProperties.inverseAspect=(float)videoProperties.h/(float)videoProperties.w;
VideoProperties &vp=videoProperties; vp.hInstance=GetModuleHandle(NULL); WNDCLASS windowClass; windowClass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; windowClass.lpfnWndProc = (WNDPROC) WndProc; windowClass.cbClsExtra = 0; windowClass.cbWndExtra = 0; windowClass.hInstance = vp.hInstance; windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); windowClass.hCursor = LoadCursor(NULL, IDC_ARROW); windowClass.hbrBackground = NULL; windowClass.lpszMenuName = NULL; #ifdef MSVC windowClass.lpszClassName = L"Engine"; #else windowClass.lpszClassName = "Engine"; #endif
if (!RegisterClass(&windowClass)) { error("Could not register WNDCLASS!",0); return 1; } vp.hwnd = CreateWindowExW(WS_EX_APPWINDOW | WS_EX_WINDOWEDGE, L"Engine", L"Engine", WS_OVERLAPPEDWINDOW, vp.x, vp.y,vp.w, vp.h, NULL, NULL, vp.hInstance, NULL);
vp.hdc=GetDC(vp.hwnd); PIXELFORMATDESCRIPTOR pfd; // Create a new PIXELFORMATDESCRIPTOR (PFD) int depthBits=32; formatTry: memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR)); // Clear our PFD pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); // Set the size of the PFD to the size of the class pfd.dwFlags = PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW; // Enable double buffering, opengl support and drawing to a window pfd.iPixelType = PFD_TYPE_RGBA; // Set our application to use RGBA pixels pfd.cColorBits = vp.bpp; // Give us 32 bits of color information (the higher, the more colors) pfd.cDepthBits = depthBits; // Give us 32 bits of depth information (the higher, the more depth levels) pfd.iLayerType = PFD_MAIN_PLANE; // Set the layer of the PFD
int nPixelFormat = ChoosePixelFormat(vp.hdc, &pfd); // Check if our PFD is valid and get a pixel format back if (nPixelFormat == 0) // If it fails { if(depthBits==8) { error("Could not create pixel format : %ix%i\n",vp.bpp,32); return 1; } warn("Could not create pixel format with %i depth bits\n",depthBits); depthBits-=8; goto formatTry;//OMG, a goto! } if(!SetPixelFormat(vp.hdc, nPixelFormat, &pfd)) // Try and set the pixel format based on our PFD { error("Could not set pixel format (%i bpp)\n",vp.bpp); return 1; } print("Created %ix%i pixel format\n",vp.bpp,depthBits); HGLRC OpenGLContext = wglCreateContext(vp.hdc); // Create an OpenGL 2.1 context for our device context wglMakeCurrent(vp.hdc, OpenGLContext); // Make the OpenGL 2.1 context current and active
ShowWindow(vp.hwnd,5); UpdateWindow(vp.hwnd); Just torn out of my engine without testing, but hopefully should help you out
|
|
|
|
|
7
|
Developer / Technical / Re: The grumpy old programmer room
|
on: April 02, 2013, 03:01:19 PM
|
|
I wrote up a little command line utility that would hide any monochrome image in another using that method a while ago. If I remember correctly World of Warcraft stores debug/user information encoded in screenshots like that so they can track you down via your screenshot if they see you doing something wrong
|
|
|
|
|
8
|
Developer / Technical / Re: The grumpy old programmer room
|
on: April 02, 2013, 02:54:30 PM
|
It's a neat idea though if you can make it work. I think that is what Monaco is doing so that the preview image and the map data are in the same file
Unless it's changed from when he first implemented it, they just use the highest bit of 2 (4 bpp) pixels to store a byte. (discussed w/ them at the time)
|
|
|
|
|
11
|
Developer / Design / Re: Magic!
|
on: March 01, 2013, 11:09:36 AM
|
|
The problem with Magicka was that by level four I just hit Fire fire arcane lightning lightning over and over, since it was the best attack out there. No strategy needed.
I've seen Darker than Black, but I can't remember a person named Wei. I remember a person named Hei.... but his powers didn't really seem like what I was describing?
|
|
|
|
|
12
|
Developer / Design / Re: Magic!
|
on: March 01, 2013, 05:33:15 AM
|
|
I found Magicka's magic system to be very interesting, although in the end I don't think it lived up to its potential. I'm not sure if there could have been enough variety with a simple base system like that at all, really. The hallmark of any "real" magic system would be the ability to create spells that hadn't been specifically coded by the programmers.
Although I haven't played nearly all the other games with magic systems, I can't think of any other ones that didn't work mainly off some derivation of a standard MP gauge, with spells assigned a certain cost, and if you're lucky the spells will have context sensitive effectivity.
I was thinking for a while about a system where you have magic throwing daggers for the various elements of spells, ranging from the normal heat/cold, wind, energy, etc, as well as an "activation" dagger. You would throw(or just stab into) the daggers at different surfaces, and then use an activation dagger to ignite the spell. The more daggers you use, the more powerful a spell would be, and things like how perfect the shape was. (you could make a "magic circle" by using six daggers, and the closer they were to being the corners of a pentagon, the stronger the spell would be)
|
|
|
|
|
13
|
Developer / Technical / Re: The grumpy old programmer room
|
on: February 20, 2013, 06:43:48 AM
|
what do you people do when you aren't working on any game and feel bored. what do you code?
I've been working on my own custom language/compiler whenever I get stuck on my game
|
|
|
|
|
14
|
Developer / Collaborations / Re: Anybody interested in working together on a small project?
|
on: February 05, 2013, 02:23:52 PM
|
I could be up for programming something, depending on what it is. Personally for small projects I'd rather not be big on the design end though
Do you think you could knock up a match three type engine? I've got a terrific setting for one...? I could, but the match three games I'm thinking of don't really have a setting... (so I worry that we're picturing different things?) You can email me at [email protected] , and I shall also check out this forum, so whatever...
|
|
|
|
|