fix function name in .net code
This commit is contained in:
parent
fa49555dde
commit
46025fd2c9
|
@ -113,7 +113,7 @@
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<AdditionalLibraryDirectories>D:\App Files\Projects\OpenGLTest\OpenGLRenderer\include;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>C:\git\OpenGLTest\OpenGLRenderer\include;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>opengl32.lib;glew32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>opengl32.lib;glew32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<NoEntryPoint>
|
<NoEntryPoint>
|
||||||
</NoEntryPoint>
|
</NoEntryPoint>
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
HGLRC hRC;
|
HGLRC hRC;
|
||||||
|
@ -95,7 +94,7 @@ DLL_API void RenderFrame()
|
||||||
SwapBuffers(wglGetCurrentDC());
|
SwapBuffers(wglGetCurrentDC());
|
||||||
}
|
}
|
||||||
|
|
||||||
DLL_API void SetupViewport(unsigned int width, unsigned int height)
|
DLL_API void SetupViewport(int width, int height)
|
||||||
{
|
{
|
||||||
VIEWPORT_WIDTH = width;
|
VIEWPORT_WIDTH = width;
|
||||||
VIEWPORT_HEIGHT = height;
|
VIEWPORT_HEIGHT = height;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define DLL_API __declspec(dllexport)
|
#define DLL_API extern "C" __declspec(dllexport)
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "include/headers/glew.h"
|
#include "include/headers/glew.h"
|
||||||
|
@ -12,6 +12,6 @@ extern "C" {
|
||||||
|
|
||||||
DLL_API void InitializeOpenGL(HWND hWnd);
|
DLL_API void InitializeOpenGL(HWND hWnd);
|
||||||
DLL_API void RenderFrame();
|
DLL_API void RenderFrame();
|
||||||
DLL_API void SetupViewport(unsigned int width, unsigned int height);
|
DLL_API void SetupViewport(int width, int height);
|
||||||
//DLL_API void Cleanup();
|
//DLL_API void Cleanup();
|
||||||
}
|
}
|
|
@ -19,12 +19,16 @@ namespace OpenGLTest
|
||||||
public static extern uint RenderFrame();
|
public static extern uint RenderFrame();
|
||||||
|
|
||||||
[DllImport(DllPath, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllPath, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern uint SetErrorCallback(GLErrorCallbackDelegate errorCallbackDelegate);
|
public static extern uint SetupViewport(int width, int height);
|
||||||
|
|
||||||
|
[DllImport(DllPath, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern uint SetGLErrorCallback(GLErrorCallbackDelegate errorCallbackDelegate);
|
||||||
|
|
||||||
public Form1()
|
public Form1()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
SetErrorCallback(HandleError);
|
SetGLErrorCallback(HandleError);
|
||||||
|
SetupViewport(panel1.Width, panel1.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void HandleError(uint errorCode, string errorMessage)
|
private static void HandleError(uint errorCode, string errorMessage)
|
||||||
|
|
Loading…
Reference in New Issue