Example #1
0
static bool buttonLogic(unsigned int id, bool over)
{
	bool res = false;
	// process down
	if (!anyActive())
	{
		if (over)
			setHot(id);
		if (isHot(id) && g_state.leftPressed)
			setActive(id);
	}

	// if button is active, then react on left up
	if (isActive(id))
	{
		g_state.isActive = true;
		if (over)
			setHot(id);
		if (g_state.leftReleased)
		{
			if (isHot(id))
				res = true;
			clearActive();
		}
	}

	if (isHot(id))
		g_state.isHot = true;

	return res;
}
Example #2
0
  static bool buttonLogic(UIPanel::State & state, uint32_t id, bool over)
  {
    bool result = false;

    // process down
    if (!anyActive(state))
    {
      if (over)
        setHot(state, id);
      if (isHot(state, id) && state.mousePressed)
        setActive(state, id);
    }

    // if button is active, then react on left up
    if (isActive(state, id))
    {
      state.isActive = true;
      if (over)
        setHot(state, id);
      if (state.mouseReleased)
      {
        if (isHot(state, id))
          result = true;
        clearActive(state);
      }
    }

    if (isHot(state, id))
      state.isHot = true;

    return result;
  }
	GlXOffscreenContext::~GlXOffscreenContext()
	{
		clearActive();

		_ready = false;

		glXDestroyContext(_display, _context);
		glXDestroyPbuffer(_display, _pBuffer);

		XCloseDisplay(_display);
	}