Call glHint(GL_FOG_HINT, GL_NICEST) to try to get pixel fog activated in more cases. (Thanks csxns, addresses #547)

This commit is contained in:
UnknownShadow200 2018-10-15 00:43:40 +11:00
parent a146eb531c
commit 95f9d55d45
2 changed files with 10 additions and 9 deletions

View File

@ -28,10 +28,9 @@ namespace ClassicalSharp.GraphicsAPI {
public OpenGLApi(INativeWindow window) {
glContext = Factory.Default.CreateGLContext(GraphicsMode.Default, window);
GL.LoadEntryPoints(glContext);
MinZNear = 0.1f;
InitFields();
MinZNear = 0.1f;
int size;
GL.GetIntegerv(GetPName.MaxTextureSize, &size);
MaxTexWidth = size; MaxTexHeight = size;
@ -39,16 +38,15 @@ namespace ClassicalSharp.GraphicsAPI {
#if !GL11
CustomMipmapsLevels = true;
CheckVboSupport();
#else
CustomMipmapsLevels = false;
#endif
base.InitCommon();
setupBatchFuncCol4b = SetupVbPos3fCol4b;
setupBatchFuncCol4b = SetupVbPos3fCol4b;
setupBatchFuncTex2fCol4b = SetupVbPos3fTex2fCol4b;
setupBatchFuncCol4b_Range = SetupVbPos3fCol4b_Range;
setupBatchFuncCol4b_Range = SetupVbPos3fCol4b_Range;
setupBatchFuncTex2fCol4b_Range = SetupVbPos3fTex2fCol4b_Range;
GL.Hint(HintTarget.FogHint, HintMode.Nicest);
GL.EnableClientState(ArrayCap.VertexArray);
GL.EnableClientState(ArrayCap.ColorArray);
}

View File

@ -792,9 +792,11 @@ static void GL_CheckVboSupport(void) {
#endif
void Gfx_Init(void) {
struct GraphicsMode mode;
GraphicsMode_MakeDefault(&mode);
GLContext_Init(&mode);
Gfx_MinZNear = 0.1f;
struct GraphicsMode mode = GraphicsMode_MakeDefault();
GLContext_Init(mode);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &Gfx_MaxTexWidth);
Gfx_MaxTexHeight = Gfx_MaxTexWidth;
@ -802,8 +804,9 @@ void Gfx_Init(void) {
Gfx_CustomMipmapsLevels = true;
GL_CheckVboSupport();
#endif
GfxCommon_Init();
glHint(GL_FOG_HINT, GL_NICEST);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
}