Jump to content

  • Log In with Google      Sign In   
  • Create Account

Headkaze

Member Since 19 Feb 2006
Offline Last Active Apr 13 2016 10:10 AM

#5078653 Sprite tearing due imprecise pixel coordinates (both uv and pos), how to fix it?

Posted by Headkaze on 18 July 2013 - 01:58 AM

Not sure what version of DirectX you're using but check out Directly Mapping Texels to Pixels (Direct3D 9) or Coordinate Systems (Direct3D 10).


#4920993 BeginInvoke event call to VB.NET

Posted by Headkaze on 10 March 2012 - 05:26 PM

VB.NET sucks doesn't it?

Unfortunately I have to have example code in several languages.

Any help would be greatly appreciated.


#4821659 From Managed DirectX to SlimDX

Posted by Headkaze on 10 June 2011 - 05:08 AM

so it doesn't have any special runtimes that need to be installed seperately.


Actually it requires a 10 MB redist install that includes DirectX, SlimDX and VC 9 runtimes.


#4816952 [.net] Reflector - no more free version

Posted by Headkaze on 28 May 2011 - 07:04 PM

Reflector v6 with no expiry date for existing users

Alternative development tools:
ILSpy: http://wiki.sharpdevelop.net/ilspy.ashx
JustDecompile: http://www.telerik.com/products/decompiling.aspx
JustTrace: http://www.telerik.com/products/memory-performance-profiler.aspx




#4229170 How to retrieve info about videocard.

Posted by Headkaze on 21 May 2008 - 08:33 AM

Here is a page that shows C++ code to get Video card info using WMI

http://www.scodz.com/ViewProgram.php?link=867

#include "comutil.h"
#include "Wbemcli.h"
#include "Wbemidl.h"

// create edit controls to display information
// add this code button event or as ur wish
HRESULT hr;
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);

IWbemLocator *pIWbemLocator = NULL;
hr = CoCreateInstance(__uuidof(WbemLocator), NULL,
CLSCTX_INPROC_SERVER, __uuidof(IWbemLocator),
(LPVOID *) &pIWbemLocator);

BSTR bstrServer = SysAllocString(L"\\\\.\\root\\cimv2");
IWbemServices *pIWbemServices;
hr = pIWbemLocator->ConnectServer(bstrServer, NULL, NULL, 0L, 0L, NULL,
NULL, &pIWbemServices);

hr = CoSetProxyBlanket(pIWbemServices, RPC_C_AUTHN_WINNT,
RPC_C_AUTHZ_NONE, NULL, RPC_C_AUTHN_LEVEL_CALL,
RPC_C_IMP_LEVEL_IMPERSONATE, NULL,
EOAC_DEFAULT);

BSTR bstrWQL = SysAllocString(L"WQL");
BSTR bstrPath = SysAllocString(L"select * from Win32_VideoController");
IEnumWbemClassObject* pEnum;
hr = pIWbemServices->ExecQuery(bstrWQL, bstrPath, WBEM_FLAG_FORWARD_ONLY, NULL, &pEnum);

IWbemClassObject* pObj = NULL;
ULONG uReturned;
VARIANT var;
hr = pEnum->Next(WBEM_INFINITE, 1, &pObj, &uReturned );

if (uReturned)
{
hr = pObj->Get(L"AdapterRAM", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char str[MAX_PATH];
sprintf(str,"Video Memory %ld",(var.lVal/(1024*1024)));

m_vidMemoryTxt.SetWindowText(str);
}

hr = pObj->Get(L"ConfigManagerErrorCode", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char str[MAX_PATH];
sprintf(str,"ConfigManagerErrorCode %ld",var.lVal);
switch (var.lVal)
{
case 0:
m_ConfigManagerErrorCodeTxt.SetWindowText("This device is working properly");
break;
case 1:
m_ConfigManagerErrorCodeTxt.SetWindowText("This device is not configured correctly");
break;
case 2:
m_ConfigManagerErrorCodeTxt.SetWindowText("Windows cannot load the driver for this device.");
break;
case 3:
m_ConfigManagerErrorCodeTxt.SetWindowText("The driver for this device might be corrupted, or your system may be running low on memory or other resources.");
break;
case 4:
m_ConfigManagerErrorCodeTxt.SetWindowText("This device is not working properly. One of its drivers or your registry might be corrupted.");
break;
case 5:
m_ConfigManagerErrorCodeTxt.SetWindowText("The driver for this device needs a resource that Windows cannot manage.");
break;
case 6:
m_ConfigManagerErrorCodeTxt.SetWindowText("The boot configuration for this device conflicts with other devices.");
break;
case 7:
m_ConfigManagerErrorCodeTxt.SetWindowText("Cannot filter.");
break;
case 8:
m_ConfigManagerErrorCodeTxt.SetWindowText("The driver loader for the device is missing");
break;
case 11:
m_ConfigManagerErrorCodeTxt.SetWindowText("This device failed.");
break;
case 12:
m_ConfigManagerErrorCodeTxt.SetWindowText("This device cannot find enough free resources that it can use.");
break;
case 14:
m_ConfigManagerErrorCodeTxt.SetWindowText("This device cannot work properly until you restart your computer.");
break;
case 18:
m_ConfigManagerErrorCodeTxt.SetWindowText("Reinstall the drivers for this device.");
break;
case 20:
m_ConfigManagerErrorCodeTxt.SetWindowText("Your registry might be corrupted.");
break;
}
}

// *********** driver name

hr = pObj->Get(L"Name", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char sString[256];
WideCharToMultiByte(CP_ACP, 0, var.bstrVal, -1, sString,

sizeof(sString), NULL, NULL);
m_nameTxt.SetWindowText(sString);
}

hr = pObj->Get(L"DeviceID", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char sString[256];
WideCharToMultiByte(CP_ACP, 0, var.bstrVal, -1, sString,

sizeof(sString), NULL, NULL);
m_deviceIdTxt.SetWindowText(sString);
}

hr = pObj->Get(L"DriverVersion", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char sString[256];
WideCharToMultiByte(CP_ACP, 0, var.bstrVal, -1, sString,

sizeof(sString), NULL, NULL);
m_VersionTxt.SetWindowText(sString);
}

hr = pObj->Get(L"DriverDate", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char str[MAX_PATH];
SYSTEMTIME lpSystemTime;
memset( &lpSystemTime, 0, sizeof( SYSTEMTIME ) );

char char_string[100]="";

//BSTR dateStr = var.bstrVal;
//_bstr_t bstrIntermediate(*dateStr); // convert to _bstr_t
//_stprintf(char_string, _T("%s"), (LPCTSTR)bstrIntermediate);

//char* lpszText2 = _com_util::ConvertBSTRToString(dateStr);

// int res= VariantTimeToSystemTime(var.bstrVal, & lpSystemTime );

/*DWORD err =::GetLastError();

sprintf(str,"%ld // %ld // %ld",lpSystemTime.wDay,lpSystemTime.wMonth,lpSystemTime.wYear);

m_InstalldateTxt.SetWindowText( str);*/

}

//VideoProcessor
hr = pObj->Get(L"VideoProcessor", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char sString[256];
WideCharToMultiByte(CP_ACP, 0, var.bstrVal, -1, sString,

sizeof(sString), NULL, NULL);
m_InstalldateTxt.SetWindowText( sString);
}

hr = pObj->Get(L"VideoModeDescription", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char sString[256];
WideCharToMultiByte(CP_ACP, 0, var.bstrVal, -1, sString,

sizeof(sString), NULL, NULL);
m_videodcrTxt.SetWindowText(sString);
}

hr = pObj->Get(L"AdapterDACType", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char sString[256];
WideCharToMultiByte(CP_ACP, 0, var.bstrVal, -1, sString,

sizeof(sString), NULL, NULL);
m_DacTypeTxt.SetWindowText(sString);
}

hr = pObj->Get(L"VideoArchitecture", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char str[MAX_PATH];
sprintf(str,"Video Memory %ld",(var.lVal));
switch(var.lVal)
{
case 5:
m_arch.SetWindowText("VGA");
break;
case 6:
m_arch.SetWindowText("SVGA");
break;
case 7:
m_arch.SetWindowText("MDA");
break;
case 10:
m_arch.SetWindowText("8514A");
break;
case 11:
m_arch.SetWindowText("XGA");
break;
case 12:
m_arch.SetWindowText("Linear Frame Buffer");
break;
}
//m_DacTypeTxt.SetWindowText(sString);
}
}

// ***********

pEnum->Release();
SysFreeString(bstrPath);
SysFreeString(bstrWQL);
pIWbemServices->Release();
SysFreeString(bstrServer);
CoUninitialize();




[Edited by - Headkaze on May 21, 2008 3:33:01 PM]


PARTNERS