Shaders Shader gm_BaseTexture problems.



I've been trying my best to understand this problem. I've read the manuals, and everything I use should be correct, but I keep getting an error.

The error I get is as follows:
Reading project file... Error compiling vertex shader:
In Shader shader_shader at line 11 : 'gm_BaseTexture' : undeclared identifier
In Shader shader_shader at line 11 : 'texture2D' : no matching overloaded function found
In Shader shader_shader at line 11 : 'r' : field selection requires structure, vector, or matrix on left hand side
Compile Failed - Please check the Compile window for any additional information
My Vertex shader is as follows:
attribute vec3 in_Position;                  // (x,y,z)
//attribute vec3 in_Normal;                  // (x,y,z)     unused in this shader.
attribute vec4 in_Colour;                    // (r,g,b,a)
attribute vec2 in_TextureCoord;              // u(,v)

varying vec4 v_vColour;

void main() {
    float zz = texture2D(gm_BaseTexture, in_TextureCoord).r;
    vec4 object_space_pos = vec4( in_Position.x * 32.0, in_Position.y * 32.0, zz * 32.0, 1.0);
    gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
    v_vColour = vec4(0, zz / 2.0, zz / 2.0, 1);
If it makes any difference, I am using GLSL ES.

As the logs tell, the error is in "texture2D(gm_BaseTexture, in_TextureCoord)", no matter what I change the in_TextureCoord the error persists, but changing gm_BaseTexture has effect, for example using an uniform sampler2D seems to fix the problem but this is not what I wish to use.

Is there a stupid mistake I'm making, or is this something bigger?