# OpenGL calls in native extension?

**URL:** <https://forum.defold.com/t/opengl-calls-in-native-extension/35225>\
**Category:** Questions\
**Created:** [November 18, 2018, 11:25pm UTC](https://forum.defold.com/t/opengl-calls-in-native-extension/35225 "2018-11-18T23:25:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dangrnoodl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dangrnoodl/32/11808_2.png) [@dangrnoodl](https://forum.defold.com/u/dangrnoodl)\
**Post date:** [November 18, 2018, 11:25pm UTC](https://forum.defold.com/t/opengl-calls-in-native-extension/35225/1 "2018-11-18T23:25:31Z")

</div>

Is it possible to get access to retrieving texture ids from a native extension and use open gl calls on it? I’m working on a custom lighting and shadowing system and I need to upload a fair bit of data to the gpu, it wouldn’t be feasible with the currently exposed render script pipeline.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [November 28, 2018, 9:18am UTC](https://forum.defold.com/t/opengl-calls-in-native-extension/35225/2 "2018-11-28T09:18:14Z")

</div>

It’s currently not possible no.

You _can_ create your own OpenGL device to create/use your own textures, but communicating them back to the engine via Lua and resource.set\_texture(), but it’s not extremely performant.

We will discuss this further in the engine to decide upon a good way forward, but it will take some time and it not likely to happen soon.

---

<div class="post-metadata">

**Author:** ![sergey.lerg](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sergey.lerg/32/3970_2.png) [@sergey.lerg](https://forum.defold.com/u/sergey.lerg)\
**Post date:** [November 28, 2018, 9:34am UTC](https://forum.defold.com/t/opengl-calls-in-native-extension/35225/3 "2018-11-28T09:34:31Z")

</div>

At the moment you can guess texture id, its not pretty, but it will allow you to experiment until a better way is implemented. Try numbers from 1 to 10 and see what happens.
