Can not control the color in JOGL

I am a beginner to use JOGL.
I find that I can not control the color, both background and foreground. The background is always Black, and foreground is always Red.
I use canvas.setBackground(Color),
gl.glColor3*(), trying to change the color. But it does not work.
What is the problem?
Thanks.
Toby

A big help for learning JOGL is reading the Red Book from OpenGL, which can be downloaded in pdf. Since JOGL is almost a direct wrapper, the function calls are identical.
To set the background color, you need to add a GLEventListener to the GLCanvas that you're using. To set the background color, in your init() method for GLEventListener do:
public void init(GLAutoDrawable glad) {
GL gl=glad.getGL();
gl.glClearColor(r,g,b);
or something similar, I'm not on my normal computer so this was all from memory. Check the JOGL API for the exact method name for glClearColor. To change the foreground color, there are a bunch of various methods that are all similar to glColor3f(float r,float g,float b).
Calling this on the GL object in the display() method will set the foreground color and everything drawn that isn't using lighting will use this color.

Similar Messages

  • Since Lion upgrade, can not change the colored label of my HD in the Finder

    ... the "Macintosh HD" icon has the Label section grayed out when I select 'Get Info'.
    I can only change the color of the USB attached disks.
    Also, before the upgrade to Lion, I was able to assign colored labels to the attached network shares, in Snow Leopard; now I can see the label colors I've assigned when using Snow L. by I can not modify then anymore...
    Any ideas?
    Thank you in advance.

    Thank you for the reply.
    Lock was closed. It open after authentication, but the word "Label" is still gray and can not select a color label.
    On the "Sharing and Permissions" have the folowing:
      "You can only read"
      "system - Read & Write"
      "wheel - Read only"
      "everyone - Read only"

  • How Can I Control Format & Color Of Text Links?

    iWeb appears to colorize and/or box or underline link text according to its own "uncontrollable" set of criteria.
    How can I control the color of a text hyperlink and turn automatic link underlining OFF?

    you CANNOT do that in iWeb. there are the following ways around iWeb which solve it:
    http://www.rowan-cottage.co.uk/Site/CSSiniWeb.html
    im bringing up a video tutorial soon, so check my site in the future!
    max

  • How can I change the color of my message bubbles on the iPod touch 4th generation

    I keep on trying it with apps but I can't do it!!

    you can not change the color of the bubbles, they are set by the iOS

  • Can I Control the Pulse offset using the Counter Out?

    Hello Everyone.
    I am trying to generate the Pulse as below;
    I have seen and understood an example to generate a pulse waveform "GenDigPulseTrain_Continuous".
    However, I can not control the offset of the pulse train.
    Although the function gives me "initial delay(The amount of time in seconds to wait before generating the first pulse)",
    I can not shift "t_dead" cycle.
    /*01.Frequency Control*/
     // The units to use to define pulse frequency.
      m_pTaskWrite->COChannels.CreatePulseChannelFrequ​ency(vecstrings[0]/*LPCTSTR counter*/,
       "PWM_C0_CH_HIGH"/*LPCTSTR nameToAssignChannel*/,
       DAQmxCOPulseFrequencyUnitsHertz,
       DAQmxCOPulseIdleStateHigh,
       dDeadTime, 
       m_nFncFrequency/*frequency*/,
       prDuty.second/*dutyCycle*/);
      // The units to use to define pulse frequency.
       m_pTaskWrite->COChannels.CreatePulseChannelFreque​ncy(vecstrings[1]/*LPCTSTR counter*/,
        "PWM_C0_CH_LOW"/*LPCTSTR nameToAssignChannel*/,
        DAQmxCOPulseFrequencyUnitsHertz,
        DAQmxCOPulseIdleStateLow,
        dDeadTime/**2 + (prDuty.second *dCycleTime)*/, 
        m_nFncFrequency/*frequency*/,
        prDuty.second/*dutyCycle*/);
    Please let me know how I solve this problem.
    Thank you

    Dear Zl,
    Counting pulses is much easier with the FP-QUAD-510 or FP-CTR-500, but can be done with the FP-AI-110.  You can't directly count the pulses with a FP-AI-110, but you can do it in software. Bring in the data by doing a normal read. Then, using shift registers, if the previous voltage is less than .8V (low) and the current voltage is more than 2.5 (high), increase the pulse count. I have attached a program that shows what to do with the data once you bring it in. I took the data from an array outside the while loop, but your data will be brought in one point at a time inside the while loop. One thing to take note of, since Fieldpoint brings in data at 1 kS/s, this will only work with pulses slower than 500 Hz. The farther the duty cycle is away from 50% duty cycle, the slower the signal must be in order to catch the pulses correctly. Please let me know if you have any questions. Have a great day!
    Sincerely,
    Marni
    PS- Please only post question once.
    Attachments:
    pulsecount.vi ‏22 KB

  • How can i search for a color that is not in the color palette? (CS 5.5)

    I have a client, that has used a certain color in a series of textfields throughout the document.
    The color consists of all 4 CMYK colors and needs to be just Keycolor. However the color is not in the swatches menu, so marking it there and changing it won't work. I have downloaded a script that might have worked, but it could only find colors that were in the swatches palette. (Find / Change by Color / Overprint" version 1.2).
    Ofcourse, creating a similar color and adding it to the swatches doesn't work.
    Is there anyway that i can search for the color or does it really have to be done manually.
    Best regards

    You can only search for real, actually existing swatches. No sweat: use "Add Unnamed Colors" in the Swatch panel dropdown menu to get a list of all of the manually applied colors.
    Since you want to change all of them to the same color, you don't even have to use Search/Replace. Simply delete the new colors and select the one you need in the "Replace With" dialog that appears.

  • I can not control my cursor with the trackpad.  It moves randomly. It began after an Angry Birds update.  Anyone else have this problem?

    I have a late 2011 OS X Lion 10.7.4 that is only 6 months old.  For the first 4 months I had no problems, but then about 6 weeks ago I downloaded an Angry Birds update from the Apple App Store, and my problems began.  When playing Angry Birds the the new Angry Birds update for the first time the cursor began to jump around, moving on it's own as if someone else was controlling it.  After a few moments I became obvious I could not control the cursor with the trackpad. When I placed the tip of my finger gently in the center of the trackpad to try to hold the cursor still it becan switching from the game (desktop) to launchpad and mission control.  I then put the computer down so I was not even touching it, walked several feet away and the cursor still moved on it's own.
    I've done a lot of research over the last few weeks on related articles and realized this is a common problem with numerous different causes: PRAM settings,
    screen sharing, remote settings, having fingers accidently touch edges of trackpad, writst resting too close to trackpad, swollen battery, etc. and I don't think it's due to any of those issues.
    The problem came out of nowhere.  My computer stays at home, and is not used by anyone else.  At first it was just Angry Birds, but now it can happen at any time.  Sometimes hours or days go by when this does not happen, sometimes it happens so much I can't use the computer at all.  It can get so bad that I won't be able to click out of whatever I'm doing on my desktop, and I'll have to shut it down by holding the power button. 
    Has anyone else had this issue after updating Angry Birds?

    try a new/fresh apple brand cable and make sure it is the only usb cable in use. this worked for me, i noticed i had no problem with a lighting cable. i did a restore from scratch and from backup and it did not help me...and if you cant sync than you wont be able to get anything but apps back after the restore

  • I can not install the Icloud control panel on a new windows 7 pc wtih outlook 2010. I get "you can't sign in because of a server error" .

    I can not install the icloud control panel on a neww windows 7 pc with outlook 2010. When i try I get "you can't inssign in because of a server error"
    I have :
    turned of the windows fire wall and antivirus protection
    stop and started the bonjour service
    done the "netsh winsock reset"
    updated all the drivers
    I can login to icloud.com with no problem and view my calendar.
    Apple chat also provide me with a test id and password to try to install the icloud panel, I got the same error message???
    Anyone have a fix?
    Thanks,

    To solve this problem you can:
    Windows 7
    1) Click on Start
    2) Type cmd and press enter
    you will see a new window
    3) type "netsh winsock reset"
    4) restart the machine
    should work.
    If still does not work you must disable the firewall and antivirus
    Para solucionar este problema debes hacer lo siguiente:
    en Windows 7
    1) click en Inicio
    2) escribe CMD y pulsa enter
    te va a aparecer una nueva ventana
    3) escribe "netsh winsock reset"
    4) reinicia la maquina
    deberia de funcionar.
    Si aun no funciona debes de deshabilitar el firewall y el antivirus

  • Can not change the control level of item attribute "Inventory Asset Value"

    I can not change the control level of the item attribute "Inventory Asset Value" from Master Level to Org Level. It's show me the message "FRM-40200: Field is protected against update".
    Version is below:
    Oracle Application: 10.7SC
    Form: INVIDCTL 6.0.26

    I did a trace when I chage the control level. the SQL is below:
    SELECT COUNT(*)
    FROM CST_ITEM_COSTS CHILD
    , CST_ITEM_COSTS MASTER
    WHERE MASTER.INVENTORY_ITEM_ID = CHILD.INVENTORY_ITEM_ID (+)
    AND MASTER.COST_TYPE_ID = 1
    AND CHILD.COST_TYPE_ID (+) = 1
    AND NVL(MASTER.ITEM_COST,0) != NVL(CHILD.ITEM_COST (+) ,DECODE(MASTER.ITEM_COST, NULL ,0,-99999))
    AND MASTER.ORGANIZATION_ID IN (SELECT MASTER_ORGANIZATION_ID
    FROM MTL_PARAMETERS
    WHERE ORGANIZATION_ID != MASTER_ORGANIZATION_ID )
    AND CHILD.ORGANIZATION_ID IN (SELECT ORGANIZATION_ID
    FROM MTL_PARAMETERS
    WHERE MASTER_ORGANIZATION_ID = MASTER.ORGANIZATION_ID )

  • Thank you guys for helping me out now I can now access my IPad. But there is one more challenge, the iPad is showing negative view so I can not see the true color of things

    Thank you guys for helping me out now I can now access my IPad. But there is one more challenge, the iPad is showing negative view so I can not see the true color of things

    Settings>General>Accessibilty and turn off white on black.
    Matt

  • I can not monitor the results of color correction made ​​in Color

    I can not monitor the results of color correction made in Color come out the Blackmagic HD exrteme 3. Since the Final
    I have cut the output correctly. I made the settings in the setupproject and setings but I had no success.

    IN the USER PREFERENCES part of the SETUP TAB, on the right, there should be a VIDEO OUT option...choose the one that matches your media.

  • I use a brower to control a VI ,but what display in the brower is only a HTML,and I can not control it.

    I want realize remote controling.So I use a brower to control a VI ,but what display in the brower is only a HTML,and I can not control it.

    > I use a brower to control a VI ,but what display in the brower is only
    > a HTML,and I can not control it.
    >
    > I want realize remote controling.So I use a brower to control a VI
    > ,but what display in the brower is only a HTML,and I can not control
    > it.
    You don't say what version you are using, but LV6.1 added remote control
    of panels.
    If already using LV6.1, look it up in the help and try out the examples.
    Greg McKaskle

  • I can not get the control panel of my blog

    I can not get the control panel of my blog with my google acount.
    http://tsalimi.blogspot.com

    i have been posting this a few places maybe it will get around.  I have found becuse of my full enclosed iphone case i can not get my figure low enough to get the control panal to work.  maybe apple can move up the control panal access to get it to work better for thos who have full cases.

  • Is there a way to automatically control the audio volume on safari? Some streaming video sites (Hulu, in particular), like to try to deafen me with the commercials. And yes, I'm not an idiot, I know that I can manually control the volume.

    I've been searching for some way to automatically control the volume, so the commercials on streaming sites (Hulu, for example), don't deafen me. And yes, I am aware that I can manually control the volume with the volume keys on the keyboard or the slider in the menubar.

    This really frustrates me, small differences between the apps that shouldn't be there.
    I understand you can't change the keyboard shortcuts to be the same/similar, but this is totally different. Let's hope it changes soon.

  • How can i change the color of the graph in agreement of the program's condition

    Hi,
    I am using labview 5.1 in my graduation's project final. (sorry by my english, but i am ina hurry)
    How can i change the color of the graph in agreement of the program's condition?
    I am developing a VI to control the temperature of termistors,but i have another sensor too.
    In a graph i have the situation of the termistors,but i want to change the color of the graph when the sensor is active.
    Thanks a lot
    Rafael Wajnsztajn - Brasil

    To change the color of the line itself, you can use the attribute Plot>>Plot Color.
    To change the color of the points, you can use the attribute Cursor>>Cursor Color.
    To select the color, you should have a color box constant inside the Numeric>>Additional Numeric Constants palette.
    This is all in LV 7.0. I'm not sure how it similar it is in 5.1.
    One important thing is to place the attribute node inside a case structure which will execute only when your condition has been filled.
    If this didn't help you, I suggest you post the relevant piece of code, or at least an image of it (no BMPs, please).
    Try to take over the world!

Maybe you are looking for

  • Safari Crashes on Launch (10.6.2)

    I'm running the version of Safari that shipped with my new MacBook Pro. However, recently I can't get it to launch. Any help would be greatly appreciated. Here's the error report I'm getting, if it's any help: Process: Safari [4097] Path: /Applicatio

  • Restricting PO line item quantity

    HI all, How should i restrict a PO line item quantity from RFQ Quantity? please help me how to restrict PO quantity. Thanks, Message was edited by: sungnam ko Message was edited by: sungnam ko

  • Spry Repeat Regions

    Is it possible to restrict repeat regions in Spry to ie. 5 or 10 records per page. I am sure we could do this before on ASP pages.

  • Time Machine - deleting older photos and files

    I've been through ~10 pages of discussions and haven't found an answer, though it's probably out there. Here goes. Wife and I haven't used Time Machine yet but would like to begin. When using TM, if we delete some photos/files from our iMac after usi

  • How to get unloading point value from Production order?

    Hi Can u tell me how can i get the Unloading Point  value from Production order where the Warehouse no, Movement Type AND Requirement Type F is given Kindly send me full select query (Table name-field name). Moderator message: please search for avail