by Spike » Wed Feb 19, 2014 12:42 pm
both FTE and DP already have opengles 2 ports.
if you want to make your own port, MarkV is as good a choice as any. enough features for it to still be somewhat usable, and a base that most people trust. As far as I'm aware, the gl changes are optimisations more so than added features, and thus there shouldn't be too much extra code in there that isn't already expected by the average user.
gles2 requires that you gut all the glBegin stuff that glquake uses. that means an almost complete rewrite of any and all code that generates mesh data (2d images, mesh interpolation, etc), this also includes static stuff like surfaces.
however, people targetting gles are generally targetting some awkward system like android or ios where there's a load of system expectations where the single-main-function doesn't really work very well. this can be a problem even with sdl2.
I'd like to think that FTE's renderer is clean in that the backend sees just trisoup and shaders, with texture, video, etc, management also abstracted away.
For instance, fte's software renderer (which is really quite poo) has an entry in fte's 'rendererinfo' array so that the setrenderer command may use it, with almost all of the rest of the code being self contained within the software-specific files. While there is an enum value assigned for it, its pretty much only used to silence warnings about a case value not being specified, and is followed by a break statement in all but one location, although admittedly this means that it does not support realtime lighting.
FTE's D3D11 renderer does include a few extra twiddles in a few places in order for the shader code to use hlsl correctly, as well as rtlights. Sadly such things are quite specific to the backend which will be using it, and isn't particuarly easy to abstract.
Of course, one man's definition of 'clean' can often be different from another man's - I suspect your definition of clean is better expressed with the word 'small'. FTE's GL renderer is far from small, despite the interface the rest of the engine uses to access it. That said, be careful of 'too small' (aka: unusable) - MarkV is probably of a suitable size.
I can't speak for DP, but these are the console commands required to get the win32 or sdl2 port of FTE to attempt to use GLES2 (the glx port does not support these at this time). Whether your graphics drivers/sdl library support gles2 contexts or not is a different matter.
vid_gl_context_es 1
vid_gl_context_version 2.0
vid_restart
.