Пример #1
0
void MainWindow::setupOpenGLState()
{
	SetFramerateLimit(60);

	glDisable(GL_LIGHTING);

//	glEnable(GL_CULL_FACE);
	glDisable(GL_CULL_FACE);
	glEnable(GL_TEXTURE_2D);
	glEnable(GL_POINTS);
	glEnable(GL_POINT_SMOOTH);
	glPointSize(10.f);

	glEnable(GL_DEPTH_TEST);
	glDepthMask(GL_TRUE);
	glClearDepth(1.f);

	glClearColor(0.1f, 0.1f, 0.1f, 1.f);
}
Пример #2
0
CGameBoard::CGameBoard(QWidget *parent, const QPoint &position, const QSize &size, unsigned int FrameTime) :
        QSFMLCanvas(parent, position, size, FrameTime)
{
    CPlayer *me = new CPlayer();
    me->setStopTime(0.15f);
    me->Pause();
    m_playersList.append(me);
    m_gameBegin = true;
    m_connected = true;
    m_warmupTime = 0;
    m_frameRate = 0.0f;
    m_pingTime = 0;
    m_roundsNumber = 0;
    m_currentRound = 0;
    m_status = Waiting_Players;
    m_bonusCanvas = NULL;
    m_networkManager = new CNetworkManager();
    SetFramerateLimit(60);
}
Пример #3
0
void MapEditorCanvas::OnInit()
{
    _view = new sf::View(sf::FloatRect(0, 0, 800, 608));

    _canvasEnabled = false;
    SetFramerateLimit(60);
    _zoomLvl = 0;
    _zoomUp = 0.8f;
    _zoomDown = 1.25f;
    _mapMode = REGULAR_MAP_MODE;
    _mouseIsPressed = false;
    updateScreenPos();


    _collisionTileImage.LoadFromFile("../resources/collision.png");

    _collisionTileSprite.SetImage(_collisionTileImage);
    _layerImage.LoadFromFile(LAYER_IMAGE_CALQUE);
    _layerSprite.SetImage(_layerImage);

    setFixedSize(800,608);
}
Пример #4
0
void sfWindow_SetFramerateLimit(sfWindow* window, unsigned int limit)
{
    CSFML_CALL(window, SetFramerateLimit(limit));
}
Пример #5
0
/// Get the input manager of a window
////////////////////////////////////////////////////////////
sfInput* sfWindow_GetInput(sfWindow* Window)
{
    CSFML_CHECK_RETURN(Window, NULL);

    return &Window->Input;
}


////////////////////////////////////////////////////////////
/// Limit the framerate to a maximum fixed frequency for a window
////////////////////////////////////////////////////////////
void sfWindow_SetFramerateLimit(sfWindow* Window, unsigned int Limit)
{
    CSFML_CALL(Window, SetFramerateLimit(Limit))
}


////////////////////////////////////////////////////////////
/// Get time elapsed since last frame of a window
////////////////////////////////////////////////////////////
float sfWindow_GetFrameTime(sfWindow* Window)
{
    CSFML_CALL_RETURN(Window, GetFrameTime(), 0.f)
}

////////////////////////////////////////////////////////////
/// Change the joystick threshold, ie. the value below which
/// no move event will be generated
///
Пример #6
0
////////////////////////////////////////////////////////////
/// Limit the framerate to a maximum fixed frequency for a window
////////////////////////////////////////////////////////////
void sfRenderWindow_SetFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit)
{
    CSFML_CALL(renderWindow, SetFramerateLimit(limit));
}