dwmkerr / sharpgl

Use OpenGL in .NET applications. SharpGL wraps all modern OpenGL features and offers a powerful scene graph to aid development.
MIT License
768 stars 300 forks source link

TexSubImage2D for pointer/IntPtr? #201

Open tqk2811 opened 3 years ago

tqk2811 commented 3 years ago
gl.TexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,
          i == 0 ? temp_frame->width : temp_frame->width / 2,
          i == 0 ? temp_frame->height : temp_frame->height / 2,
          GL_RED, GL_UNSIGNED_BYTE, 
          (IntPtr)(temp_frame->data[i]));// only allow int[]

Hi, i'm new on OpenGl. Is there way to use TexSubImage2D without using managed array? Thanks!
Note: temp_frame is AVFrame* from ffmpeg