Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7717121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:48:18+00:00 2026-06-01T02:48:18+00:00

I’ve just started learning LWJGL (Java OpenGL), and i’m encountering an enormous amount of

  • 0

I’ve just started learning LWJGL (Java OpenGL), and i’m encountering an enormous amount of lag on my program.

Basically, I’m trying to make a 2.5D Minecraft clone, so what I’ve done for the world code is create a multidimensional array of the “Block” class i made Its 150 By 50 . Here’s the code for my world class so far:

enter image description here

And here is my render loop:

enter image description here

Some extra info, all the draw method for the “Block” class does is draw all the sides of a cube, except for the back.

So, what is happening is that it is rendering a big wall of cubes (What i wanted), except that the FPS is VERY bad.

I’m not quite sure what I’m doing wrong. And remember that I need an array of cubes because since it’s going to be like Minecraft, i’m going to have to be able to easily organize the blocks, and be able to destroy/place blocks depending on what the user does.

Thanks!

Edit: Draw Method For The Block Class:

    Texture stone = Util.createTexture("Tiles/Stone.png");

    stone.bind();
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

    glBegin(GL_QUADS);
        //FRONT FACE
        glTexCoord3f(0,1,z);
        glVertex3f(x,y,z);

        glTexCoord3f(1,1,z);
        glVertex3f(x + width,y,z);

        glTexCoord3f(1,0,z);
        glVertex3f(x + width,y + height,z);

        glTexCoord3f(0,0,z);
        glVertex3f(x,y + height, z);

        //RIGHT FACE
        glTexCoord3f(0,1,z);
        glVertex3f(x + width,y,z);

        glTexCoord3f(1,1,z - length);
        glVertex3f(x + width,y,z - length);

        glTexCoord3f(1,0,z - length);
        glVertex3f(x + width,y + height,z - length);

        glTexCoord3f(0,0,z);
        glVertex3f(x + width,y + height,z);
        //LEFT FACE
        glTexCoord3f(0,1,z);
        glVertex3f(x,y,z);

        glTexCoord3f(1,1,z - length);
        glVertex3f(x,y,z - length);

        glTexCoord3f(1,0,z - length);
        glVertex3f(x,y + height,z - length);

        glTexCoord3f(0,0,z);
        glVertex3f(x,y + height,z);

        //TOP FACE
        glTexCoord3f(0,1,z - length);
        glVertex3f(x,y + height,z - length);

        glTexCoord3f(1,1,z - length);
        glVertex3f(x + width,y + height,z - length);

        glTexCoord3f(1,0,z);
        glVertex3f(x + width,y + height,z);

        glTexCoord3f(0,0,z);
        glVertex3f(x,y + height,z);

        //BOTTOM FACE
        glTexCoord3f(0,1,z - length);
        glVertex3f(x,y,z - length);

        glTexCoord3f(1,1,z - length);
        glVertex3f(x + width,y,z - length);

        glTexCoord3f(1,0,z);
        glVertex3f(x + width,y,z);

        glTexCoord3f(0,0,z);
        glVertex3f(x,y,z);
    glEnd();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:48:19+00:00Added an answer on June 1, 2026 at 2:48 am

    You shouldn’t create the texture every time block.draw() is called. Call it once, before you do any rendering.

    Texture stone = Util.createTexture("Tiles/Stone.png");
    

    It would also improve your performance to use vertex arrays instead of immediate mode drawing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.