Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't generate textures #2

Open
DCubix opened this issue May 18, 2016 · 0 comments
Open

Can't generate textures #2

DCubix opened this issue May 18, 2016 · 0 comments

Comments

@DCubix
Copy link

DCubix commented May 18, 2016

I'm trying to use glGenTextures(n:Int, textures:Array), but it gives me the following error:

Error: ./src/com/pixd/Texture.cpp: In static member function ‘static com::pixd::Texture com::pixd::Texture_obj::load(String)’:
./src/com/pixd/Texture.cpp:83:25: error: ‘GLuint’ was not declared in this scope
  glGenTextures((int)1, (GLuint*)&(Array_obj< int >::__new().Add(tex->m_gpuTex)[0]));
                         ^
./src/com/pixd/Texture.cpp:83:32: error: expected primary-expression before ‘)’ token
  glGenTextures((int)1, (GLuint*)&(Array_obj< int >::__new().Add(tex->m_gpuTex)[0]));
                                ^
./src/com/pixd/Texture.cpp:83:83: error: ‘glGenTextures’ was not declared in this scope
  glGenTextures((int)1, (GLuint*)&(Array_obj< int >::__new().Add(tex->m_gpuTex)[0]));
                                                                                   ^
Error: Build failed

Code:

var tex = new Texture();
var rawdata = sys.io.File.getBytes(fileName);

var sdata = Image.load_from_memory(rawdata.getData(), rawdata.length, 4);
var sinfo = Image.info_from_memory(rawdata.getData(), rawdata.length);

glGenTextures(1, [tex.m_gpuTex]);

Also why an Array? The function can be re-written to simply return an Array or a single Int since Haxe doesn't do pointers like C++ does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant