Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

115 Neutral

About OrcSlayer

  • Rank
  1. I have a char buffer, and I fill it with sprintf, but when I try to MessageBox the string, I get an error, when trying to convert to USHORT* how can I do it?
  2. OrcSlayer

    Problem with GAPI...

    Thanks :) that was the problem!
  3. I try to run the simplest program on my iPaq (older version, 2000 I think) and I cant run in fullscreen... here is the code: #include <windows.h> #include <GX.h> HWND g_hWnd; HINSTANCE g_hInst; unsigned char g_szClass[] = "ShellClass"; unsigned char g_szCaption[] = "Caption"; GXDisplayProperties gx_displayprop; GXKeyList gx_keylist; long ScreenWidth=200,ScreenHeight=320; void ClearScreen(int r, int g, int b); int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow); long FAR PASCAL WindowProc(HWND hWnd, UINT uMsg,WPARAM wParam, LPARAM lParam); int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { WNDCLASS wc; MSG Msg; g_hInst = hInst; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = (WNDPROC) WindowProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInst; wc.hIcon = 0; wc.hCursor = 0; wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); wc.lpszMenuName = 0; wc.lpszClassName = (const unsigned short *)g_szClass; if(!RegisterClass(&wc)) return FALSE; g_hWnd=CreateWindow((const unsigned short *)g_szClass, (const unsigned short *)g_szCaption,WS_BORDER | WS_POPUP,0, 0, ScreenWidth, ScreenHeight,NULL, NULL,hInst, NULL ); if(!g_hWnd) return FALSE; if (GXOpenDisplay(g_hWnd,GX_FULLSCREEN)==0) { MessageBox(g_hWnd,L"Unable to initilize graphics",L"Error",MB_OK); return FALSE; } GXOpenInput(); gx_keylist = GXGetDefaultKeys(GX_NORMALKEYS); gx_displayprop = GXGetDisplayProperties(); if (gx_displayprop.cBPP !=16) { GXCloseDisplay(); MessageBox(g_hWnd,L"Error, can work only with 16BPP",L"ERROR",MB_OK); return FALSE; } UpdateWindow(g_hWnd); ClearScreen(0,0,0); ZeroMemory(&Msg, sizeof(MSG)); while(Msg.message != WM_QUIT) { if(PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&Msg); DispatchMessage(&Msg); } else { } } return TRUE; } long FAR PASCAL WindowProc(HWND hWnd, UINT uMsg,WPARAM wParam, LPARAM lParam) { short vkKey; switch(uMsg) { case WM_KEYDOWN: vkKey = (short)wParam; if (vkKey == gx_keylist.vkUp) { ClearScreen(255,0,0); break; } if (vkKey == gx_keylist.vkDown) { PostQuitMessage(0); break; } case WM_DESTROY: GXCloseInput(); GXCloseDisplay(); PostQuitMessage(0); break; case WM_KILLFOCUS: GXSuspend(); break; case WM_SETFOCUS: GXResume(); break; default: return DefWindowProc(hWnd, uMsg, wParam, lParam); } return 0; } void ClearScreen(int r, int g, int b) { // Get the start of the screen memory from the GX function. unsigned short * buffer = (unsigned short *) GXBeginDraw(); if (buffer == NULL) return; // Calculate the pixel color from the r,g,b components. unsigned short PixelCol; if (gx_displayprop.ffFormat & kfDirect565) { PixelCol = (unsigned short) (r & 0xff) << 11 | (g & 0xff) << 6 | (b & 0xff); } else { PixelCol = (unsigned short) (r & 0xff) << 10 | (g & 0xff) << 5 | (b & 0xff); } // Use two loops to fill the entire screen with the necessary color for (unsigned int y=0; y<gx_displayprop.cyHeight; y++) { unsigned short * pixel = buffer; for (unsigned int x=0; x<gx_displayprop.cxWidth; x++) { *pixel = PixelCol; pixel += gx_displayprop.cbxPitch >> 1; } buffer += gx_displayprop.cbyPitch >> 1; } // End the drawing code GXEndDraw(); }
  4. OrcSlayer

    Terrain Rendering

    Quote:Original post by okifarhad Hi I am very interested in terrain rendering in DirectX and I can't find any sample to begin. Thanks. Sorry for my very bad english. check this out.
  5. OrcSlayer

    Long Way Home - pls try out

    I think he's loading each frame a texture or something like this
  6. OrcSlayer

    what is MDX?

    I never heard about Managed C++, I know this is .NET related, right? I dont even know what exactly is .NET (even that I have VS.NET) can anyone spare some tome to explain to me?
  7. OrcSlayer

    what is MDX?

    I know what the acronyms mean, but what is new about it? in what programming languages I can use it? I know this is probably a stupid question, but...
  8. OrcSlayer

    Quality of code is getting lower and lower?

    Quote:Original post by CoffeeMug Quote:Original post by OrcSlayer first of all, dont laugh about my spelling, english is not my primary language. You don't capitalize the first letter of a sentence in your language? There is no capital letters in my language...
  9. OrcSlayer

    Quality of code is getting lower and lower?

    Quote:Original post by Oluseyi Quote:Original post by OrcSlayer do you think it's truth that the quality of the code is getting worst and worst by time?First of all, things get "worse" (a description of continuing deterioration), not "worst" (which is final, and thus can't keep happening). Second, your programming skills are negligible, given your lack of comprehension of the value of powerful flow control constructs. Not every loop is condition-controlled; sometimes you intentionally write what would seem to be an infinite loop and use a break or other exit statement to terminate it because that's the most logical, efficient and readable way to code it. In summary, learn to program before speaking about global code quality. Don't be hasty to assess things you don't fully comprehend. If such features are popular in several languages, then maybe there's a good reason why. Let the evidence suggest the argument rather than finding evidence to support a pre-disposition. Happy hacking. first of all, dont laugh about my spelling, english is not my primary language. second of all, you are right that my programming skills are not great, I'm only 17 years old, and I'm learning to program by myself (and in school, but the level of programming in school is VERY low). but still I allways try to program right, and not use "Exit looptype" or continue or goto, because I think it's just wrong... you dont need to be that way... and judge me for everything I say (including my english skills, I do my best)
  10. do you think it's truth that the quality of the code is getting worst and worst by time? the programming languages can really let you do stupid things... lets say in VB, you can exit any loop, by typing "Exit LoopType", instead of programming in a right way, and just get your condition right, in QBasic (or basic) you couldn't do that... in C++, break, goto and that kind of stuff, I never use them, I think it's wrong programming, is it allways was that way?
  11. OrcSlayer

    2d isometric by d3d

    In the Articles in the DirectX section you will find articles about how to make 2D with Direct3D, and there is a section for isometric too, with alot of good articles...
  12. OrcSlayer


    very fun game! I enjoyed playing it! can you do one thing? show a HP bar of the bosses? this can be nice...
  13. OrcSlayer

    Simple Asteroids clone

    preety cool, I love this style of game (just lines).
  14. how do they handle the map? is it tile based or pixel based (each pixel is stored)? ohh, and how they do the collision? it's very accurate... thx, and sorry if the question is not in the right forum.
  15. OrcSlayer

    A hand full of GOOD and FREE games :-D

    I just noticed you released the source for CrossFire! that can help me :-) the code is great, it dosent suck as you said! just a quick (and weird) question, how old are you?
  • 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!