Skip to content

Commit 15ac162

Browse files
committed
🚨 Fixed warning by adding a cast when registering vertex buffer
1 parent 960041e commit 15ac162

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Plugin/PluginInteropUnityCUDA/src/Buffer/vertex_buffer_OpenGLCoreES.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#pragma once
22
#include "vertex_buffer_OpenGLCoreES.h"
3-
#include "openGL_include.h"
4-
#include <cuda_gl_interop.h>
5-
// OpenGL Core profile (desktop) or OpenGL ES (mobile) implementation of RenderAPI.
6-
// Supports several flavors: Core, ES2, ES3
7-
83

94
#if SUPPORT_OPENGL_UNIFIED
105

@@ -24,8 +19,9 @@ VertexBuffer_OpenGLCoreES::~VertexBuffer_OpenGLCoreES()
2419
/// </summary>
2520
void VertexBuffer_OpenGLCoreES::registerBufferInCUDA()
2621
{
27-
// cast the pointer on the buffer of unity to gluint
28-
GLuint glBuffer = (GLuint)(_bufferHandle);
22+
// cast the pointer on the buffer of unity to gluint
23+
// (first to size_t to avoid a warning C4311)
24+
GLuint glBuffer = (GLuint)(size_t)(_bufferHandle);
2925
//glBindBuffer(GL_PIXEL_UNPACK_BUFFER, glBuffer);
3026
GL_CHECK();
3127
//register the buffer to cuda : it initialize the _pGraphicsResource

0 commit comments

Comments
 (0)