[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("kernal32")]
private static extern bool QueryPerformanceFrequency(ref
long PerformanceFrequency);
[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("kernal32")]
private static extern bool QueryPerformaceCounter(ref
long PerformanceCount);
It throws me a System.dllNotFoundException in my game loop.
I tired to changing it to "kernal32.dll", but that didn't work. I tired a quick search to see if it had anything to do with the fact i'm running 64 bit win7, but I couldn't find anything on that. I have been able to get DLLimport to work in the past with other dll files, I am unsure why it isn't working with this dll.
Any help I can get is greatly appreciated.
LiquidWotter
[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("kernal32")]
private static extern bool QueryPerformanceFrequency(ref
long PerformanceFrequency);
[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("kernal32")]
private static extern bool QueryPerformaceCounter(ref
long PerformanceCount);
It throws me a System.dllNotFoundException in my game loop.
I tired to changing it to "kernal32.dll", but that didn't work. I tired a quick search to see if it had anything to do with the fact i'm running 64 bit win7, but I couldn't find anything on that. I have been able to get DLLimport to work in the past with other dll files, I am unsure why it isn't working with this dll.
Any help I can get is greatly appreciated.
LiquidWotter
Check your spelling (it's k-e-r-n-e-l not kernal).
EDIT:
Also, you can use the Stopwatch class in System.Diagnostics instead of pinvoking QueryPerformaceCounter.
Also thanks for the class suggestion, I knew there had to be an easier way, but I am currently going through a book so I'm doing it the author's way first hehe.