mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 03:55:19 -04:00
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:
parent
a146eb531c
commit
95f9d55d45
@ -28,10 +28,9 @@ namespace ClassicalSharp.GraphicsAPI {
|
|||||||
public OpenGLApi(INativeWindow window) {
|
public OpenGLApi(INativeWindow window) {
|
||||||
glContext = Factory.Default.CreateGLContext(GraphicsMode.Default, window);
|
glContext = Factory.Default.CreateGLContext(GraphicsMode.Default, window);
|
||||||
GL.LoadEntryPoints(glContext);
|
GL.LoadEntryPoints(glContext);
|
||||||
|
|
||||||
MinZNear = 0.1f;
|
|
||||||
InitFields();
|
InitFields();
|
||||||
|
|
||||||
|
MinZNear = 0.1f;
|
||||||
int size;
|
int size;
|
||||||
GL.GetIntegerv(GetPName.MaxTextureSize, &size);
|
GL.GetIntegerv(GetPName.MaxTextureSize, &size);
|
||||||
MaxTexWidth = size; MaxTexHeight = size;
|
MaxTexWidth = size; MaxTexHeight = size;
|
||||||
@ -39,16 +38,15 @@ namespace ClassicalSharp.GraphicsAPI {
|
|||||||
#if !GL11
|
#if !GL11
|
||||||
CustomMipmapsLevels = true;
|
CustomMipmapsLevels = true;
|
||||||
CheckVboSupport();
|
CheckVboSupport();
|
||||||
#else
|
|
||||||
CustomMipmapsLevels = false;
|
|
||||||
#endif
|
#endif
|
||||||
base.InitCommon();
|
base.InitCommon();
|
||||||
|
|
||||||
setupBatchFuncCol4b = SetupVbPos3fCol4b;
|
setupBatchFuncCol4b = SetupVbPos3fCol4b;
|
||||||
setupBatchFuncTex2fCol4b = SetupVbPos3fTex2fCol4b;
|
setupBatchFuncTex2fCol4b = SetupVbPos3fTex2fCol4b;
|
||||||
setupBatchFuncCol4b_Range = SetupVbPos3fCol4b_Range;
|
setupBatchFuncCol4b_Range = SetupVbPos3fCol4b_Range;
|
||||||
setupBatchFuncTex2fCol4b_Range = SetupVbPos3fTex2fCol4b_Range;
|
setupBatchFuncTex2fCol4b_Range = SetupVbPos3fTex2fCol4b_Range;
|
||||||
|
|
||||||
|
GL.Hint(HintTarget.FogHint, HintMode.Nicest);
|
||||||
GL.EnableClientState(ArrayCap.VertexArray);
|
GL.EnableClientState(ArrayCap.VertexArray);
|
||||||
GL.EnableClientState(ArrayCap.ColorArray);
|
GL.EnableClientState(ArrayCap.ColorArray);
|
||||||
}
|
}
|
||||||
|
@ -792,9 +792,11 @@ static void GL_CheckVboSupport(void) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void Gfx_Init(void) {
|
void Gfx_Init(void) {
|
||||||
|
struct GraphicsMode mode;
|
||||||
|
GraphicsMode_MakeDefault(&mode);
|
||||||
|
GLContext_Init(&mode);
|
||||||
|
|
||||||
Gfx_MinZNear = 0.1f;
|
Gfx_MinZNear = 0.1f;
|
||||||
struct GraphicsMode mode = GraphicsMode_MakeDefault();
|
|
||||||
GLContext_Init(mode);
|
|
||||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &Gfx_MaxTexWidth);
|
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &Gfx_MaxTexWidth);
|
||||||
Gfx_MaxTexHeight = Gfx_MaxTexWidth;
|
Gfx_MaxTexHeight = Gfx_MaxTexWidth;
|
||||||
|
|
||||||
@ -802,8 +804,9 @@ void Gfx_Init(void) {
|
|||||||
Gfx_CustomMipmapsLevels = true;
|
Gfx_CustomMipmapsLevels = true;
|
||||||
GL_CheckVboSupport();
|
GL_CheckVboSupport();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GfxCommon_Init();
|
GfxCommon_Init();
|
||||||
|
|
||||||
|
glHint(GL_FOG_HINT, GL_NICEST);
|
||||||
glEnableClientState(GL_VERTEX_ARRAY);
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
glEnableClientState(GL_COLOR_ARRAY);
|
glEnableClientState(GL_COLOR_ARRAY);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user