i think i *might* have it. but it wont work, dont know if its me :/ :: hook the SetPixelFormat function =D.... Trying to make a modified cl_metamod... Will eventually strip out the "plugin management" bit so it just hooks me the SetPixelFormat stuff...
if (!InterceptDllCall( GetModuleHandle(NULL), "Gdi32.dll", "SetPixelFormat",(PVOID)&newSetPixelFormat, (PVOID*)&oldSetPixelFormat,NULL)) ::MessageBox(NULL, "its not worked!", ":|", MB_OK);
and well wot do you now O_O it tells me the opp failed :( InterceptDllCall works for GetProcAddress in cl_metamod :/, wot am doing wrong...
This is my replacement code:
typedef int (WINAPI *SetPixelFormatFunc)(HDC,int,PIXELFORMATDESCRIPTOR*); SetPixelFormatFunc oldSetPixelFormat;
int newSetPixelFormat(HDC hdc, int ipix, PIXELFORMATDESCRIPTOR *pfd) { pfd->cDepthBits = 32; pfd->cStencilBits = 1;
::MessageBox(NULL,"testing!", "test!", MB_OK);
return oldSetPixelFormat(hdc,ipix,pfd); }
Obviously this will probably get detected by VAC or woteva so Im gonna have to label it heavily or something :/ jc wrote:
Pretty pretty please? Something like:
stencil = Cvar_Get( "r_stencilbits", "0", 0 ); pfd.cStencilBits = (int)max(0, stencil->value);
If you dont I'll end up killing myself trying to do something with WGL_ARB_pbuffer or another render-to-memory hdc >_>..... You dont want me to end up killing myself do you O_o death by code.... thats how I want to go....
jc
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders