OldSchoolHack

Register / Login English

Falsche World2Screen Berechnung

icon Thread: Falsche World2Screen Berechnung

Join Date: Aug 2007

Posts: 8646

User-Rating:

199 positive
33 negative
ich benutze bei meiner Engine Klasse nicht das SDK, weil mir da zuviel drin ist, was ich nicht brauche.

CPP Code:
  1. typedef void* (*CreateInterfaceFn)(const char *name, int *returnCode);
  2.  
  3. CreateInterfaceFn CaptureFactory(char *FactoryModuleName)
  4. {
  5. CreateInterfaceFn ret = NULL;
  6.  
  7. while (!ret)
  8. {
  9. HMODULE FactoryModule = GetModuleHandleA(FactoryModuleName);
  10.  
  11. if (FactoryModule)
  12. ret = reinterpret_cast<CreateInterfaceFn>(GetProcAddress(FactoryModule, "CreateInterface"));
  13.  
  14. Sleep(10);
  15. }
  16.  
  17. return ret;
  18. }
  19. //---------------------------------------------------------------------------
  20. void *CaptureInterface(CreateInterfaceFn Fn, char *InterfaceName)
  21. {
  22. unsigned long *ret = NULL;
  23.  
  24. while (!ret)
  25. {
  26. ret = reinterpret_cast<unsigned long*>(Fn(InterfaceName, NULL));
  27. Sleep(10);
  28. }
  29.  
  30. return ret;
  31. }
  32.  
  33. ...
  34.  
  35. Engine *engine;
  36.  
  37. CreateInterfaceFn engineInterface = CaptureFactory("engine.dll");
  38. engine = (cEngine*)CaptureInterface(engineInterface, "VEngineClient013");
  39.  
  40. ...
  41.  
  42. float *WorldToScreen = engine->WorldToScreenMatrix();

greetz KN4CK3R

__________________

Hallo