Jump to content

Recommended Posts

Posted

Hello, I have a problem when create the GUI in full screen. The fact that minecraft scales resolution in gui and etc. I have a question, is it possible to disable it, that the resolution is not scaled? My code:

glMatrixMode(GL_PROJECTION)
        glMatrix {
            glLoadIdentity()
            glViewport(0, 0, mc.displayWidth, mc.displayHeight)
            glOrtho(0.0, 800.0, 600.0, 0.0, 1000.0, 3000.0)

            glMatrixMode(GL_MODELVIEW)
            glMatrix {
                glLoadIdentity()
                glTranslated(0.0, 0.0, -2000.0)
                glClearColor(1.0f, 1.0f, 1.0f, 0.0f)
                glClearDepth(1.0)
                glClear(GL11.GL_COLOR_BUFFER_BIT or GL11.GL_DEPTH_BUFFER_BIT)
                // render something
                glMatrixMode(GL_MODELVIEW)
            }
            glMatrixMode(GL_PROJECTION)
        }

P.s. glMatrix ->

GLStateManager.pushMatrix()

block() <- Kotlin blocks

GLStateManager.popMatrix()

Posted

Well first and foremost stop using GL11 directly. Use GlStateManager.

Why do you need to disable the GUI scaling exactly? You can easily draw anything you want based on width/height and have your fullscreen GUI independent of the scaling factor.

 

3 hours ago, WildHeart said:

glMatrix ->

GLStateManager.pushMatrix()

You don't actually need to be pushing/popping matrix here at all because if you are doing it in the middle of your operations you are screwing them up and once your drawing is done the game will reset the matrix anyway.

 

3 hours ago, WildHeart said:

// render something

glMatrixMode(GL_MODELVIEW)

The matrix mode is already modelview though. You've just set it to modelview 7 lines above and you haven't changed it.

 

3 hours ago, WildHeart said:

glClearColor(1.0f, 1.0f, 1.0f, 0.0f)

glClearDepth(1.0)

glClear(GL11.GL_COLOR_BUFFER_BIT or GL11.GL_DEPTH_BUFFER_BIT)

Any reason you are doing this? The game just did that for you like 6 operations or so ago. You are not using a different framebuffer after all and the one currently in use has just been cleared.

 

3 hours ago, WildHeart said:

glViewport(0, 0, mc.displayWidth, mc.displayHeight)

You don't need to be doing this. The viewport is already set to the game's display width/height. Or to the custom framebuffer's resolution. In fact you could be screwing up someone's framebuffer setup by doing that.

 

Apart from all that looks fine-ish to me. Fix all that and see if you have any more issues.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • seguridad seguridad
    • I am creating a server with mods but when i try tostart it it say in the logs:   [29Jan2025 20:36:50.715] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/fmlcore/1.20.1-47.3.27/fmlcore-1.20.1-47.3.27.jar is missing mods.toml file 159[29Jan2025 20:36:50.717] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /server/libraries/net/minecraftforge/javafmllanguage/1.20.1-47.3.27/javafmllanguage-1.20.1-47.3.27.jar 160[29Jan2025 20:36:50.717] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/javafmllanguage/1.20.1-47.3.27/javafmllanguage-1.20.1-47.3.27.jar is missing mods.toml file 161[29Jan2025 20:36:50.718] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /server/libraries/net/minecraftforge/lowcodelanguage/1.20.1-47.3.27/lowcodelanguage-1.20.1-47.3.27.jar 162[29Jan2025 20:36:50.718] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/lowcodelanguage/1.20.1-47.3.27/lowcodelanguage-1.20.1-47.3.27.jar is missing mods.toml file 163[29Jan2025 20:36:50.719] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /server/libraries/net/minecraftforge/mclanguage/1.20.1-47.3.27/mclanguage-1.20.1-47.3.27.jar 164[29Jan2025 20:36:50.719] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/mclanguage/1.20.1-47.3.27/mclanguage-1.20.1-47.3.27.jar is missing mods.toml file
    • How do you configure the entity reach of a custom weapon? Asking for 1.21 Minecraft parchment
    • This topic is over a year old. If you are having an issue, please read the FAQ for the proper way to post logs, and create your own thread.
    • hello i have been trying to put this specific pack for a while now but ive been hit with a new error everytime. no matter if its a previous version or if i change the pack format it will just not work please help latest log:https://mclo.gs/b6Qra5d <----- this is with pack version 1.20 no changes done to it debug log: https://mclo.gs/jczkfRK
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.