Skip to content

Commit

Permalink
Merge pull request #459 from raziel-/patch-1
Browse files Browse the repository at this point in the history
JANITORIAL: Fix a few typos in comments
  • Loading branch information
ptitSeb authored May 19, 2024
2 parents 47ff5d6 + 276270f commit 746e3c3
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 38 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Version history
* Added support for GL_ARB_draw_elements_base_vertex

##### v1.0.8
* Fixes and improvments to avoid unnecessary GLES state changes
* Fixes and improvements to avoid unnecessary GLES state changes
* Fixes some memory issues with glBitmap
* Fixes to FPE (when using multitexture and GL_COMBINE)
* Added some TexEnv extension for GLES2 backend
Expand Down Expand Up @@ -136,8 +136,8 @@ Version history
* Tracking Clip Planes
* Refactor Blitting function, and use glDrawTex extension if present
* Restructured README and split in several files
* Some improvments and fixes to LIBGL_BEGINEND=2 mode
* Some improvments to some LIBGL_SHRINK mode
* Some improvements and fixes to LIBGL_BEGINEND=2 mode
* Some improvements to some LIBGL_SHRINK mode
* Proper support for DOT3 extension
* Some fixes to Read/Draw Buffer handling
* Some fix with the PixMap glX context creation
Expand Down
2 changes: 1 addition & 1 deletion COMPILE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Use with [ios-cmake](https://github.com/leetal/ios-cmake)
*Custom build*
---

Alternatively, you can use the curses-bases ccmake (or any other gui frontend for cmake) to select wich platform to use interactively.
Alternatively, you can use the curses-bases ccmake (or any other gui frontend for cmake) to select which platform to use interactively.

You can avoid the use of X11 with `NOX11=1` and EGL with `NOEGL=1`, but then, you will need to create the EGL Context yourself (or using SDL for example). Be sure to synchronize the context you create with the Backend you use. By default GLES 1.1 backend is used. To used GLES2 by default, use `DEFAULT_ES=2`

Expand Down
4 changes: 2 additions & 2 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Control the availability of the LUMINANCE_ALPHA format (can be buggy on Pandora
##### LIBGL_BLENDHACK
Experimental: Change Blend GL_SRC_ALPHA, GL_ONE to GL_ONE, GL_ONE
* 0 : Default, nothing special
* 1 : Change Blend GL_SRC_ALPHA, GL_ONE to GL_ONE, GL_ONE (can be usefull for Xash3D engine)
* 1 : Change Blend GL_SRC_ALPHA, GL_ONE to GL_ONE, GL_ONE (can be useful for Xash3D engine)

##### LIBGL_BLENDCOLOR
Hack: Export a (faked) glBlendColor
Expand Down Expand Up @@ -319,7 +319,7 @@ Define EGL lib to use. Default folder are the standard one for dynamic library l
* /path/to/filename: try to use exact path/filename. If not found/loaded, default one will be tried.

##### LIBGL_GLES
Define GLES(2) lib to use. Default folder are the standard one for dynamic library loading (LD_LIBRARY_PATH and friend) plus "/opt/vc/lib/", /usr/local/lib/" and "/usr/lib/". Be sure to point to correct GLES library depending on wich GLES backend you are using.
Define GLES(2) lib to use. Default folder are the standard one for dynamic library loading (LD_LIBRARY_PATH and friend) plus "/opt/vc/lib/", /usr/local/lib/" and "/usr/lib/". Be sure to point to correct GLES library depending on which GLES backend you are using.
* by default try to use libGLESv1_CM, libGLES_CM or libbrcmGLESv1_CM for GLES1.1 and libGLESv2_CM, libGLESv2 or libbrcmGLESv2 for GLES2 backend
* filename: try to load from the defaults folder (don't forget to use complete filename, with ".so" extension). If not found/loaded, default one will be tried.
* /path/to/filename: try to use exact path/filename. If not found/loaded, default one will be tried.
Expand Down
4 changes: 2 additions & 2 deletions src/agl/amigaos.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ void os4OpenLib(void** lib)
}
}
*lib = LOGLES2;
// small debug message, always helpfull at beggining
SHUT_LOGD("OGLES2 Library and Interface open successfuly\n");
// small debug message, always helpful at beginning
SHUT_LOGD("OGLES2 Library and Interface opened successfully!\n");
}

// Close OGLES2 lib and interface
Expand Down
2 changes: 1 addition & 1 deletion src/gl/drawing.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ GLuint len_indices(const GLushort *sindices, const GLuint *iindices, GLsizei cou
for (int i=0; i<count; i++)
if (len<iindices[i]) len = iindices[i]; // get the len of the arrays
}
return len+1; // lenght is max(indices) + 1 !
return len+1; // length is max(indices) + 1 !
}

static void glDrawElementsCommon(GLenum mode, GLint first, GLsizei count, GLuint len, const GLushort *sindices, const GLuint *iindices, int instancecount) {
Expand Down
4 changes: 2 additions & 2 deletions src/gl/fpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ void APIENTRY_GL4ES fpe_glDrawElementsInstanced(GLenum mode, GLsizei count, GLen
inds = (void*)indices;
bindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
//realize_bufferIndex(); // not usefull here
//realize_bufferIndex(); // not useful here
for (GLint id=0; id<primcount; ++id) {
GoUniformiv(glprogram, glprogram->builtin_instanceID, 1, 1, &id);
for(int i=0; i<hardext.maxvattrib; i++)
Expand Down Expand Up @@ -1735,7 +1735,7 @@ int builtin_CheckUniform(program_t *glprogram, char* name, GLint id, int size) {
}
// lightsource
if(strncmp(name, lightsource_code, strlen(lightsource_code))==0 || strncmp(name, lightsource_fpe_code, strlen(lightsource_fpe_code))==0) {
// it a light! grab it's number - also, fpe or not fpe is the same lenght. The fpe version avoid the array...
// it's a light! grab it's number - also, fpe or not fpe is the same length. The fpe version avoids the array...
int n = name[strlen(lightsource_code)]-'0'; // only 8 light, so this works
if(n>=0 && n<hardext.maxlights) {
if(strstr(name, ".ambient")) glprogram->builtin_lights[n].ambient = id;
Expand Down
8 changes: 4 additions & 4 deletions src/gl/framebuffers.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ void APIENTRY_GL4ES gl4es_glFramebufferTexture2D(GLenum target, GLenum attachmen
texture = tex->glname;
tex->fbtex_ratio = (globals4es.fbtexscale > 0.0f) ? globals4es.fbtexscale : 0.0f;

// check if texture is shrinked or if fb texture is being scaled...
// check if texture was shrunk or if fb texture is being scaled...
if (globals4es.fbtexscale > 0.0f || tex->shrink || tex->useratio || (tex->adjust && (hardext.npot==1 || hardext.npot==2) && !globals4es.potframebuffer)) {
LOGD("%s texture for FBO\n",(tex->useratio)?"going back to npot size pot'ed":"unshrinking shrinked");
if(tex->shrink || tex->useratio) {
Expand Down Expand Up @@ -1564,7 +1564,7 @@ void APIENTRY_GL4ES gl4es_glClearBufferiv(GLenum buffer, GLint drawbuffer, const
if(hardext.drawbuffers)
gles_glDrawBuffers(1, (const GLenum *) &drawbuffer);
gl4es_glGetFloatv(GL_COLOR_CLEAR_VALUE, oldclear);
// how to convert the value? Most FB will be 8bits / componant for now...
// how to convert the value? Most FB will be 8bits / component for now...
gl4es_glClearColor(value[0]/127.0f, value[1]/127.0f, value[2]/127.0f, value[3]/127.0f);
gl4es_glClear(GL_COLOR_BUFFER_BIT);
gl4es_glClearColor(oldclear[0], oldclear[1], oldclear[2], oldclear[3]);
Expand Down Expand Up @@ -1609,7 +1609,7 @@ void APIENTRY_GL4ES gl4es_glClearBufferuiv(GLenum buffer, GLint drawbuffer, cons
if(hardext.drawbuffers)
gles_glDrawBuffers(1, (const GLenum *) &drawbuffer);
gl4es_glGetFloatv(GL_COLOR_CLEAR_VALUE, oldclear);
// how to convert the value? Most FB will be 8bits / componant for now...
// how to convert the value? Most FB will be 8bits / component for now...
gl4es_glClearColor(value[0]/255.0f, value[1]/255.0f, value[2]/255.0f, value[3]/255.0f);
gl4es_glClear(GL_COLOR_BUFFER_BIT);
gl4es_glClearColor(oldclear[0], oldclear[1], oldclear[2], oldclear[3]);
Expand Down Expand Up @@ -1642,7 +1642,7 @@ void APIENTRY_GL4ES gl4es_glClearBufferfv(GLenum buffer, GLint drawbuffer, const
if(hardext.drawbuffers)
gles_glDrawBuffers(1, (const GLenum *) &drawbuffer);
gl4es_glGetFloatv(GL_COLOR_CLEAR_VALUE, oldclear);
// how to convert the value? Most FB will be 8bits / componant for now...
// how to convert the value? Most FB will be 8bits / component for now...
gl4es_glClearColor(value[0], value[1], value[2], value[3]);
gl4es_glClear(GL_COLOR_BUFFER_BIT);
gl4es_glClearColor(oldclear[0], oldclear[1], oldclear[2], oldclear[3]);
Expand Down
2 changes: 1 addition & 1 deletion src/gl/glstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ void* NewGLState(void* shared_glstate, int es2only) {
glstate->face.front = GL_CCW;
// Point Sprite
glstate->pointsprite.size = 1.0f;
glstate->pointsprite.sizeMax = 32.0f; // spec indicate 1., but it seems it's set to hardware limit, so puting 32...
glstate->pointsprite.sizeMax = 32.0f; // spec indicate 1., but it seems it's set to hardware limit, so putting 32...
glstate->pointsprite.fadeThresholdSize = 1.0f;
glstate->pointsprite.distance[0] = 1.0f;
glstate->pointsprite.coordOrigin = GL_UPPER_LEFT;
Expand Down
2 changes: 1 addition & 1 deletion src/gl/light.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void APIENTRY_GL4ES gl4es_glMaterialfv(GLenum face, GLenum pname, const GLfloat
// if a glMaterialfv is called inside a glBegin/glEnd block
// then use rlMaterial to store in current list the material wanted
// as if the material was asked before the glBegin()
// It's not real behavour, but it's better then nothing
// It's not real behaviour, but it's better then nothing
rlMaterialfv(glstate->list.active, face, pname, params);
noerrorShim();
return;
Expand Down
4 changes: 2 additions & 2 deletions src/gl/line.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ GLfloat *gen_stipple_tex_coords(GLfloat *vert, GLushort *sindices, modeinit_t *m
vertPos = vert+stride*sindices[i+1];
else
vertPos+=stride;
// need to take "w" componant into acount...
// need to take "w" component into account...
if(v[3]==0.0f) {
x1=v[0]*w; y1=v[1]*h;
} else {
Expand All @@ -121,7 +121,7 @@ GLfloat *gen_stipple_tex_coords(GLfloat *vert, GLushort *sindices, modeinit_t *m
len += sqrtf((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)) / (glstate->linestipple.factor * 16.f);
DBG(printf("%f->%f (%f,%f -> %f,%f)\t", oldlen, len, x1, y1, x2, y2);)
if(sindices)
texPos = tex+texstride*sindices[i+0]; // it get writen 2*, but that should be ok, it's the same value
texPos = tex+texstride*sindices[i+0]; // it gets written 2*, but that should be ok, it's the same value
memset(texPos, 0, 4*sizeof(GLfloat));
texPos[0] = oldlen; texPos[3] = 1.0f;
if(sindices)
Expand Down
6 changes: 3 additions & 3 deletions src/gl/planes.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void APIENTRY_GL4ES gl4es_glClipPlanef(GLenum plane, const GLfloat *equation)
If the dot product of the eye coordinates of a vertex with the stored plane equation components is positive or zero,
the vertex is in with respect to that clipping plane. Otherwise, it is out.
*/
PUSH_IF_COMPILING(glClipPlanef); //TODO: fix that, equation is an array and should be copied before beeing put in the stack
PUSH_IF_COMPILING(glClipPlanef); //TODO: fix that, equation is an array and should be copied before being put in the stack
if((plane<GL_CLIP_PLANE0) || (plane>=GL_CLIP_PLANE0+hardext.maxplanes)) {
errorShim(GL_INVALID_ENUM);
return;
Expand All @@ -23,11 +23,11 @@ void APIENTRY_GL4ES gl4es_glClipPlanef(GLenum plane, const GLfloat *equation)
LOAD_GLES2(glClipPlanef);
errorGL();
gles_glClipPlanef(plane, equation);
} else { // TODO: should fist compute the clipplane and compare to stored one before sending to hardware
} else { // TODO: should first compute the clipplane and compare to stored one before sending to hardware
int p = plane-GL_CLIP_PLANE0;
matrix_vector(getInvMVMat(), equation, glstate->planes[p]); //Tested, seems ok
noerrorShim();
}
}

AliasExport(void,glClipPlanef,,(GLenum pname, const GLfloat* params));
AliasExport(void,glClipPlanef,,(GLenum pname, const GLfloat* params));
2 changes: 1 addition & 1 deletion src/gl/program.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ GLvoid APIENTRY_GL4ES gl4es_glGetObjectParameteriv(GLhandleARB obj, GLenum pname
gl4es_glGetProgramiv(obj, pname, params);
else
gl4es_glGetShaderiv(obj, pname, params);
// hack, some program don't take into account that the lenght return by GL_OBJECT_INFO_LOG_LENGTH_ARB exclude the '\0'.. so adding it here
// hack, some programs don't take into account that the length returned by GL_OBJECT_INFO_LOG_LENGTH_ARB exclude the '\0'.. so adding it here
if(pname==GL_INFO_LOG_LENGTH)
(*params)++;
}
Expand Down
6 changes: 3 additions & 3 deletions src/gl/shaderconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,15 @@ char* ConvertShader(const char* pEntry, int isVertex, shaderconv_need_t *need)
}
int notexarray = globals4es.notexarray || need->need_notexarray || fpeShader;

//const char* GLESUseFragHighp = "#extension GL_OES_fragment_precision_high : enable\n"; // does this one is needed?
//const char* GLESUseFragHighp = "#extension GL_OES_fragment_precision_high : enable\n"; // is this needed?
char GLESFullHeader[512];
int wanthighp = !fpeShader;
if(wanthighp && !hardext.highp) wanthighp = 0;
int versionHeader = 0;
#if 0
// support for higher glsl require much more work
// around some keyword
// like in/out that depend on the shader beeing vertex or fragment
// like in/out that depends on the shader being vertex or fragment
// and a few other little things...
if(versionString && strcmp(versionString, "120")==0)
version120 = 1;
Expand Down Expand Up @@ -818,7 +818,7 @@ char* ConvertShader(const char* pEntry, int isVertex, shaderconv_need_t *need)
notexarray = 1;
need->need_notexarray = 1;
}
// check constaints
// check constraints
if (!notexarray && ntex+nvarying>hardext.maxvarying) ntex = hardext.maxvarying - nvarying;
need->need_texcoord = ntex;
char d[100];
Expand Down
2 changes: 1 addition & 1 deletion src/gl/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ typedef struct {
gltexture_t *bound[MAX_TEX][ENABLED_TEXTURE_LAST]; //TODO: this should be shared
gltexture_t *zero; // this is texture 0...
GLboolean pscoordreplace[MAX_TEX];
khash_t(tex) *list; // this is shared amoung glstate
khash_t(tex) *list; // this is shared among glstate
GLuint active; // active texture
GLuint client; // client active texture
} texture_state_t;
Expand Down
2 changes: 1 addition & 1 deletion src/gl/stb_dxt_104.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static void stb__DitherBlock(unsigned char *dest, unsigned char *block)
int err[8],*ep1 = err,*ep2 = err+4, *et;
int ch,y;

// process channels seperately
// process channels separately
for (ch=0; ch<3; ++ch) {
unsigned char *bp = block+ch, *dp = dest+ch;
unsigned char *quant = (ch == 1) ? stb__QuantGTab+8 : stb__QuantRBTab+8;
Expand Down
2 changes: 1 addition & 1 deletion src/gl/texture.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ void APIENTRY_GL4ES gl4es_glTexImage2D(GLenum target, GLint level, GLint interna
glstate->proxy_intformat = swizzle_internalformat((GLenum *) &internalformat, format, type);
return;
}
// actualy bound if targetting shared TEX2D
// actually bound if targeting shared TEX2D
realize_bound(glstate->texture.active, target);

if (glstate->list.pending) {
Expand Down
2 changes: 1 addition & 1 deletion src/gl/texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ typedef struct {
GLuint renderstencil;
int trace; // internal use for debug
GLvoid *data; // in case we want to keep a copy of it (it that case, always RGBA/GL_UNSIGNED_BYTE
glsampler_t sampler; // internal sampler if not superceeded by glBindSampler
glsampler_t sampler; // internal sampler if not superseded by glBindSampler
glsampler_t actual; // actual sampler
float fbtex_ratio; // Lower rendering resolution
} gltexture_t;
Expand Down
4 changes: 2 additions & 2 deletions src/gl/texture_compressed.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void APIENTRY_GL4ES gl4es_glCompressedTexImage2D(GLenum target, GLint level, GLe
}
FLUSH_BEGINEND;

// actualy bound if targetting shared TEX2D
// actually bound if targeting shared TEX2D
realize_bound(glstate->texture.active, target);

gltexture_t* bound = glstate->texture.bound[glstate->texture.active][itarget];
Expand Down Expand Up @@ -350,7 +350,7 @@ void APIENTRY_GL4ES gl4es_glCompressedTexSubImage2D(GLenum target, GLint level,
const GLuint itarget = what_target(target);
FLUSH_BEGINEND;

// actualy bound if targetting shared TEX2D
// actually bound if targeting shared TEX2D
realize_bound(glstate->texture.active, target);

gltexture_t *bound = glstate->texture.bound[glstate->texture.active][itarget];
Expand Down
4 changes: 2 additions & 2 deletions src/gl/texture_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void APIENTRY_GL4ES gl4es_glBindTexture(GLenum target, GLuint texture) {

LOAD_GLES(glBindTexture);
switch(target) {
// cube map are bounded immediatly, other are defered and will be applied with realize_bound or realize_textures
// cube map are bounded immediately, other are defered and will be applied with realize_bound or realize_textures
case GL_TEXTURE_CUBE_MAP:
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
Expand Down Expand Up @@ -877,7 +877,7 @@ void realize_textures(int drawing) {
GLenum target = map_tex_target(to_target(tgt));
gltexture_t *tex = glstate->texture.bound[i][tgt];
GLuint t = tex->glname;
if(tgt!=ENABLED_CUBE_MAP) {// CUBE MAP are immediatly bound
if(tgt!=ENABLED_CUBE_MAP) {// CUBE MAP are immediately bound
#ifdef TEXSTREAM
if(glstate->bound_stream[i]) {
realize_active();
Expand Down
4 changes: 2 additions & 2 deletions src/gl/texture_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void APIENTRY_GL4ES gl4es_glCopyTexImage2D(GLenum target, GLint level, GLenum
FLUSH_BEGINEND;
const GLuint itarget = what_target(target);

// actualy bound if targetting shared TEX2D
// actually bound if targeting shared TEX2D
realize_bound(glstate->texture.active, target);

if (globals4es.skiptexcopies) {
Expand Down Expand Up @@ -101,7 +101,7 @@ void APIENTRY_GL4ES gl4es_glCopyTexImage2D(GLenum target, GLint level, GLenum
void APIENTRY_GL4ES gl4es_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLint x, GLint y, GLsizei width, GLsizei height) {
const GLuint itarget = what_target(target);
// WARNING: It seems glColorMask has an impact on what channel are actualy copied by this. The crude glReadPixel / glTexSubImage cannot emulate that, and proper emulation will take need 2 read pixels.
// WARNING: It seems glColorMask has an impact on what channel are actually copied by this. The crude glReadPixel / glTexSubImage cannot emulate that, and proper emulation will take need 2 read pixels.
// And using the real glCopyTexSubImage2D needs that the FrameBuffer were data are read is compatible with the Texture it's copied to...
DBG(printf("glCopyTexSubImage2D(%s, %i, %i, %i, %i, %i, %i, %i), bounded texture=%u format/type=%s, %s\n", PrintEnum(target), level, xoffset, yoffset, x, y, width, height, (glstate->texture.bound[glstate->texture.active][itarget])?glstate->texture.bound[glstate->texture.active][itarget]->texture:0, PrintEnum((glstate->texture.bound[glstate->texture.active][itarget])?glstate->texture.bound[glstate->texture.active][itarget]->format:0), PrintEnum((glstate->texture.bound[glstate->texture.active][itarget])?glstate->texture.bound[glstate->texture.active][itarget]->type:0));)
// PUSH_IF_COMPILING(glCopyTexSubImage2D);
Expand Down
2 changes: 1 addition & 1 deletion src/glx/gbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static int init_drm_and_gbm()
printf("LIBGL: DRM no connected connector!\n");
return 0;
}
/* find prefered mode or the highest resolution mode: */
/* find preferred mode or the highest resolution mode: */
for (i = 0, area = 0; i < connector->count_modes; i++) {
drmModeModeInfo *current_mode = &connector->modes[i];

Expand Down
2 changes: 1 addition & 1 deletion src/glx/glx.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ struct __GLXFBConfigRec {

unsigned int multiSampleSize; /* Number of samples per pixel (0 if no ms) */

unsigned int nMultiSampleBuffers; /* Number of availble ms buffers */
unsigned int nMultiSampleBuffers; /* Number of available ms buffers */
int maxAuxBuffers;

/* frame buffer level */
Expand Down

0 comments on commit 746e3c3

Please sign in to comment.