Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8647593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:06:30+00:00 2026-06-12T13:06:30+00:00

This is a MonoTouch-specific question. I’m currently developing a wrapper for OpenGL which is

  • 0

This is a MonoTouch-specific question.

I’m currently developing a wrapper for OpenGL which is quite different from wrappers like OpenTK. This wrapper is used to enable faster development with OpenGL.

Methods are not declared like this: void glGenTextures(Int32 n, UInt32[] textures);, they are declared like void glGenTextures(Int32 count, [Out]TextureHandle[] textures) where TextureHandle is a structure with the same size as a UInt32.

Question

On Windows i can use GetProcAddress, wglGetProcAddress and Marshal.GetDelegateForFunctionPointer to create a delegate from a method pointer, but how to do this on iOS with MonoTouch. Is there any way to this or is it not supported by monotouch yet?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:06:31+00:00Added an answer on June 12, 2026 at 1:06 pm

    Starting with MonoTouch 5.4 this is possible. You need to create a delegate with the same signature as the managed method, and decorate it with the MonoNativeFunctionWrapper attribute:

    [MonoNativeFunctionWrapper]
    public delegate void glGenTexturesDelegate (int n, uint[] textures);
    

    Now you can call the method:

    var del = (glGenTexturesDelegate) Marshal.GetDelegateForFunctionPointer (pointer);
    del (n, textures);
    

    That said, I believe you’re doing this a lot more complicated than you need to. Just use a P/Invoke:

    [llImport("libGLESv2.dll")]
    extern static void glGenTextures (int n, uint[] textures);
    

    and then call it like this:

    glGenTextures (n, textures);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is a duplicate of 1042830 , but MonoTouch-specific. Is there a way
I have a question similar to this question but it is MonoTouch specific. When
I'm trying to call EWS from MonoTouch like in this snippet: byte[] bytes =
I accidentally bumped into an ad like this: http://monotouch.net/DownloadTrial?ref=so1 . Then I start to
this is my first question in here, and I would like to ask if
I tired this example: http://wiki.monotouch.net/HowTo/Sound/How_to_record_sound_using_the_iPhone_microphone But when I change the AudioFileType, from a compressed
Being new to MonoTouch this is a best practice type of question. If in
An older version of MonoTouch added the following code from its template. Is this
This question is directly related to this SO question I posed about 15 minutes
This question is kind of a follow up to this question I asked a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.