Question: I want to have same shader source for OpenGL ES and OpenGL (Windows). To do this I want to define custom data types and use only OpenGL ES functions. 

One approach is to define:

```
#define highp
#define mediump
#define lowp

```

for Windows shader and write the shader as it is for OpenGL ES.

Other approach is to define custom data types like this for OpenGL ES:

```
#define hvec2 highp vec2

```

and like this for Windows

```
#define hvec2 vec2

```

What do you think is better? Do you have other solutions for this problem?

Answer: 
You could use <http://www.opengl.org/registry/specs/ARB/ES2_compatibility.txt>

> 
> This extension adds support for features of OpenGL ES 2.0 that are missing from OpenGL 3.x. Enabling these features will ease the process of porting applications from OpenGL ES 2.0 to OpenGL.
> 
> 
>
I managed it by just defining the following at the begin of each shader when the shader runs on windows:

```
#define lowp
#define mediump
#define highp

```

Additional i give the shader the information which plattform is used ( WINDOWS, MOBILE, IOS ) which can be used this way:

```
#ifdef WINDOWS
precision mediump float;
#endif

```