View previous topic :: View next topic |
Author |
Message |
dav1d
Joined: 12 Sep 2011 Posts: 40
|
Posted: Sat Jun 23, 2012 4:44 am Post subject: glShaderSource |
|
|
This commit https://github.com/aldacron/Derelict3/commit/bbf2cc32afa13f18f7af439baaf235bce25d3c3f broke this code:
Code: | auto ssp = shader_source.ptr; # shader_source = string
int ssl = cast(int)(shader_source.length);
glShaderSource(shader, 1, &ssp, &ssl); |
The Error:
Code: | Error: function pointer glShaderSource (uint, int, const(char)**, const(int)*) is not callable using argument types (uint,int,immutable(char)**,int*) |
Why did you change that and what is the proper way of passing the shader source? |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Sat Jun 23, 2012 5:05 am Post subject: Re: glShaderSource |
|
|
dav1d wrote: | This commit https://github.com/aldacron/Derelict3/commit/bbf2cc32afa13f18f7af439baaf235bce25d3c3f broke this code:
Code: | auto ssp = shader_source.ptr; # shader_source = string
int ssl = cast(int)(shader_source.length);
glShaderSource(shader, 1, &ssp, &ssl); |
The Error:
Code: | Error: function pointer glShaderSource (uint, int, const(char)**, const(int)*) is not callable using argument types (uint,int,immutable(char)**,int*) |
Why did you change that and what is the proper way of passing the shader source? |
I changed it because I was getting a similar error doing it a different way. Anyway, this works for me:
Code: |
const(char)* src = source.toStringz();
glShaderSource(shader, 1, &src, null);
|
You don't have to go the toStringz route. Just drop the auto and declare your source pointer as const(char)* explicitly, and that should do it. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
dav1d
Joined: 12 Sep 2011 Posts: 40
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|