cancel
Showing results for 
Search instead for 
Did you mean: 

SDK Discussions

Highlighted
Adept I
Adept I

c# FrameBufferGetInfo help

Jump to solution

Hi i been using the c# wrapper (RadeonProRender.cs) and can after following the 32_gl_interop tutorial everything works up top the point of the FrameBufferGetInfo

here is my c# converted version

Rpr.Check((int)Rpr.FrameBufferGetInfo(g_frame_buffer_2, Rpr.FrameBuffer.DATA,
glControl.Width * glControl.Height * sizeof(float) * 4, ppObj,out sizewrect));

but getting errors is there any code examples of using c# with say opentk to get realtime rendering

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adept I
Adept I

Re: c# FrameBufferGetInfo help

Jump to solution

Ok got it working in c# Opentk in case anyone else needs it

int size = Marshal.SizeOf(g_fbdata[0]) * g_fbdata.Length;
pnt = Marshal.AllocHGlobal(size);

Marshal.Copy(g_fbdata, 0, pnt, g_fbdata.Length);

Rpr.Check((int)Rpr.FrameBufferGetInfo(g_frame_buffer_2,Rpr.FrameBuffer.DATA,(glControl.Width * glControl.Height) * sizeof(float)*4,pnt, out out_size));


float[] managedArray2 = new float[g_fbdata.Length];

Marshal.Copy(pnt, managedArray2, 0, g_fbdata.Length);

GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, glControl.Width, glControl.Height,PixelFormat.Rgba,PixelType.Float, managedArray2);

View solution in original post

0 Kudos
1 Reply
Highlighted
Adept I
Adept I

Re: c# FrameBufferGetInfo help

Jump to solution

Ok got it working in c# Opentk in case anyone else needs it

int size = Marshal.SizeOf(g_fbdata[0]) * g_fbdata.Length;
pnt = Marshal.AllocHGlobal(size);

Marshal.Copy(g_fbdata, 0, pnt, g_fbdata.Length);

Rpr.Check((int)Rpr.FrameBufferGetInfo(g_frame_buffer_2,Rpr.FrameBuffer.DATA,(glControl.Width * glControl.Height) * sizeof(float)*4,pnt, out out_size));


float[] managedArray2 = new float[g_fbdata.Length];

Marshal.Copy(pnt, managedArray2, 0, g_fbdata.Length);

GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, glControl.Width, glControl.Height,PixelFormat.Rgba,PixelType.Float, managedArray2);

View solution in original post

0 Kudos