• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

388 Neutral

About ibutsu

  • Rank
  1. Quote:Original post by rohde
  2. Plug-in Architecture

    As far as half-life goes, the game dll exports a certain set of functions that the engine requires exist, next it has macros that link entity names in the maps to the entities in the game dll by creating functions and exporting them. So, when the engine loads a map, it can find all the entities fairly easily. and it can control what classes are used to create certain objects (like the players, what game rules to use, etc) based on the config files and/or command line (it's a dethmatch game so load the deathmatch rules, the deathmatch rules spawn default players, etc). Essentially, it uses a hard coded interface while allowing extreme flexibility, so long as you play within the confines of the engines limits.
  3. MsgProc() problem

    The way to properly encapsulate the window procedure is a tad tricky, but here is the best way I know of to do it, using the source code I have. this is in the function of my window class (Window) that creates the window: HWND hWnd = CreateWindow(WindowClass.lpszClassName, WindowTitle, WS_OVERLAPPEDWINDOW|WS_VISIBLE, 0,0, 800, 600, 0,0, InstanceHandle, static_cast<LPVOID>(this)); What this does is store a pointer to the Window class object in the createstruct passed to the wndproc when the WM_CREATE message is sent now in the static Window Procedure function you have: LRESULT CALLBACK Window::WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam) { if( uMessage == WM_CREATE ) { CREATESTRUCT* cs = (CREATESTRUCT*)lParam; // I originally had pragmas around the two reinterpret_casts //to disable warnings, I don't remember if they are needed if( SetWindowLongPtr(hWnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(cs->lpCreateParams)) ) throw C3DGblObj::Exception("Could not set window user data"); } Windows::Window* LongWindow = reinterpret_cast<Windows::Window*> GetWindowLongPtr(hWnd, GWLP_USERDATA)); if (LongWindow) { switch( uMessage ) { case WM_MOUSEMOVE: LongWindow->OnMouseMove(wParam, lParam); break; } } return DefWindowProc(hWnd, uMessage, wParam, lParam); } What this code does is when WM_CREATE is handled, it retrieves the Window object pointer and stores it in the user data section of the window, then each time the window procedure is called, it retrieves the window object pointer for the window. Now you can call any functions you need from within the static window procedure, while guaranteeing you have the correct window object pointer for the window you are handling.
  4. Gaming mice

    I have a Logitech MX510 (which I assume you meant by the MX810, since there is no 810). It's pretty good, but you would probably be slightly better off with the MX518 since it has twice the DPI, oh and never use USB for desktops, ps/2 > usb for mice. - ibutsu
  5. ethics and space exploration...

    They go to arms because we let them, the government says "we need weapons and a military, because if we don't have one, someone else will come and attack us." and each government says that, the people shrug and so each government spends money on arms. - ibutsu
  6. GD.NET Ontario is sadly over...

    I don't think it would be coldacid without it :p Oh, and zahlman informs me Chris has your stuff Rob, and that Frasier has your stuff Chris. - ibutsu
  7. Hey guys, I had a great time, we should do that again some time. Perhaps I should lurk upon these forums more often, if the people I met were any representation of the people on this forum as a whole, I could be talking to lots of cool people :) anyhoo, I'm pooped, night all! - ibutsu
  8. GDNet Ontario (TONIGHT)

    Me! ME! I'll enlist, do I get a gun?!
  9. GDNet Ontario (TONIGHT)

    4th is fine for me, maybe I'll have a fancy new paycheque then too!
  10. GDNet Ontario (TONIGHT)

    I'm a foxxy taco
  11. GDNet Ontario (TONIGHT)

    I'm definately up for a meet, depending on how late it goes for I may head to System Sound Bar afterwards (hurray for clubs, or something). alcohol and video games, is there a better combination?
  12. Crazy lightning pics

    Those lightning pics are pretty damn awesome, I may use one for my desktop too :P That's a pretty cool fire pic though, Anna. *get's strange urge to burn things*
  • Advertisement