Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to make an object blink with OpenGL?

How to make an object blink with OpenGL?

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicsgame-devtutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yonggoo
    wrote on last edited by
    #1

    Hi! In a window, there are several triangle objects. I want one of these to blink if I hit a button that is related with. I don't want to use any MFC etc, only standard c++ and OpenGL. Is there any good way? Yonggoo

    R E 2 Replies Last reply
    0
    • Y Yonggoo

      Hi! In a window, there are several triangle objects. I want one of these to blink if I hit a button that is related with. I don't want to use any MFC etc, only standard c++ and OpenGL. Is there any good way? Yonggoo

      R Offline
      R Offline
      Ryan Binns
      wrote on last edited by
      #2

      Yonggoo wrote:

      How to make an object blink with OpenGL?

      Shine a really, really bright light in its eyes ;) Seriously though, I think the only way is to add/remove your object to/from the scene at the speed you want it to blink at.

      Ryan

      "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

      1 Reply Last reply
      0
      • Y Yonggoo

        Hi! In a window, there are several triangle objects. I want one of these to blink if I hit a button that is related with. I don't want to use any MFC etc, only standard c++ and OpenGL. Is there any good way? Yonggoo

        E Offline
        E Offline
        El Corazon
        wrote on last edited by
        #3

        Ryan is correct. OpenGL has no memory of the previous frame, you redraw it each time. Though there are shortcuts for repeated structures to shorten and speed up operations, you are drawing each frame one at a time, so blinking, you basically don't draw it (or draw it with a very dim grey, or don't alternate shining a light on it and away). This provides the blinking. _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups