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 8275585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:07:24+00:00 2026-06-08T08:07:24+00:00

I’m doing a Gr 12 Project. the basic idea is to render a map

  • 0

I’m doing a Gr 12 Project. the basic idea is to render a map texture that can be changed via the swing GUI.
I’m stuck at rendering using a Display that’s .parented to a JFrame.
Nothing is showing up and i cant figure it out. ive changed the backround color and the rendering color. heres some of the code:

   public class DisplayWindow extends JFrame{

   public Canvas canvas = new Canvas();                           
   private JPanel westPanel=new JPanel();                         
   private List animalArr;                                       
   private List animalOptionsBoxArr;                                                              
   public JLabel optionsLabel=new JLabel();                       
   public JToggleButton animalIOToggle = new JToggleButton();     
   public JTextArea animalIOText = new JTextArea();               

   List renderableEntities= new ArrayList();                      

   //states modified by logic class that handle all swing listners 
   private boolean resizePending=false;  
   private boolean exitPending=false;   

   DisplayWindow(List animalArr)
   {
     super(); 
     this.animalArr=animalArr; //created from db in logic class
   }
   public void run()
   {
     startDisplay();   
   }


   public void startDisplay() 
   {  
      //Init GUI

      setupFrame();             //setup main Jframe
      setupMainPanels();        //setup main panels within JFrames borderLayout)
      setupContentPanels();     //setup the content panels within the main panel

      canvas.setSize(getDisplayWidth(), getDisplayHeight());     
      canvas.setFocusable(true);                                
      canvas.setIgnoreRepaint(true);                         

      this.add(canvas,BorderLayout.CENTER);                       
      this.setVisible(true);                                     

      //Display Setup
      try
      {
         Display.setResizable(true);  
         Display.setParent(canvas);                            
         Display.sync(60);            
         Display.create();            
      }
      catch(LWJGLException ex)
      {
        Error.fatalError("Failed to Initialise Park Display",ex);  
      } 

      //OpenGL INIT                    
      glClearColor(0.0f,0.0f,0.0f,0.0f); //black backround                          
      glEnable(GL11.GL_TEXTURE_2D);     
      glEnable(GL11.GL_BLEND);                                    
      glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);

      glMatrixMode(GL_PROJECTION);                                 
      glLoadIdentity();                                            
      glOrtho(0,getDisplayWidth(),0,getDisplayHeight(),1,-1);      
      glMatrixMode(GL_MODELVIEW);   

      //Render Loop    
      while(!isExitPending())                     
      {
           glClear(GL_COLOR_BUFFER_BIT);
           render();

           checkResizeDisplay();
           Display.update();
      }
      cleanUp();
   }

  public void render()
  { 
     //test Render 
     glColor3f(1,1,1);             //white render color
     glRectf(100,100,400,400);     
     glBegin(GL_POINTS);           //point at 5 above mouse location
     glVertex2d(Mouse.getX(),Mouse.getY()+5 );
     glEnd();
  } 

  public void checkResizeDisplay() //is this even neccisary?
 {   
     if(resizePending==true)
     {
         glMatrixMode(GL_PROJECTION);                                 
         glLoadIdentity();                                            
         glOrtho(0,Display.getWidth(),0,Display.getHeight(),1,-1);      
         glMatrixMode(GL_MODELVIEW);                                   
     }

 }

} 

There is allot of code so I dearly hope the problem is in there. I tried to format it a bit. that will explain unused objects/references ext. this is the only code related to LWJGL. DisplayWindow is run as a new Runnable thread.
This is what the program looks like at the moment:
grr http://img839.imageshack.us/img839/6697/grrf.jpg

Why is nothing showing in the display?

  • 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-08T08:07:25+00:00Added an answer on June 8, 2026 at 8:07 am

    Fixed. it came down to a very basic lack of understanding. i was trying to render a coloured rectangle with

    glColor3f(1,1,1); 
    

    while

    GL_TEXTURE_2D 
    

    was enabled. it seems

    glDisable(GL11.GL_TEXTURE_2D );
    

    must be called before a colored shape will render. assuming that

    glEnable(GL11.GL_TEXTURE_2D );
    

    has already been called.

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

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am trying to render a haml file in a javascript response like so:
Does anyone know how can I replace this 2 symbol below from the string

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.