本文整理汇总了C++中sf::Window::create方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::create方法的具体用法?C++ Window::create怎么用?C++ Window::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sf::Window
的用法示例。
在下文中一共展示了Window::create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void init()
{
sf::ContextSettings settings;
settings.depthBits = 24;
settings.stencilBits = 8;
settings.antialiasingLevel = 2;
window.create(sf::VideoMode(800, 600), "Bezier_Spline_Wireframe", sf::Style::Close, settings);
glewExperimental = true;
glewInit();
initShaders();
// Store the data for the triangles in a buffer that the gpu can use to draw
glGenVertexArrays(1, &vao0);
glBindVertexArray(vao0);
glGenBuffers(1, &vbo);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
glGenBuffers(1, &ebo0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo0);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(elements), elements, GL_STATIC_DRAW);
// Bind buffer data to shader values
posAttrib = glGetAttribLocation(shaderProgram, "position");
glEnableVertexAttribArray(posAttrib);
glVertexAttribPointer(posAttrib, 3, GL_FLOAT, GL_FALSE, 0, 0);
glGenVertexArrays(1, &vao1);
glBindVertexArray(vao1);
glGenBuffers(1, &vbo);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
glGenBuffers(1, &ebo1);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo1);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(outlineElements), outlineElements, GL_STATIC_DRAW);
// Bind buffer data to shader values
posAttrib = glGetAttribLocation(shaderProgram, "position");
glEnableVertexAttribArray(posAttrib);
glVertexAttribPointer(posAttrib, 3, GL_FLOAT, GL_FALSE, 0, 0);
timer.restart();
time_t timer;
time(&timer);
srand((unsigned int)timer);
generateTeapot();
InputManager::Init(&window);
CameraManager::Init(800.0f / 600.0f, 60.0f, 0.1f, 100.0f);
glEnable(GL_DEPTH_TEST);
}
示例2: GameData
Global() {
wnd.create(sf::VideoMode(640, 360), "Testing");
glewExperimental = GL_TRUE;
glewInit();
d = new GameData(&log, &work, getGamePath());
e = new GameWorld(&log, &work, d);
e->data->loadIMG("/models/gta3");
e->data->loadIMG("/anim/cuts");
e->data->load();
for(std::map<std::string, std::string>::iterator it = e->data->ideLocations.begin();
it != e->data->ideLocations.end();
++it) {
d->loadObjects(it->second);
}
e->dynamicsWorld->setGravity(btVector3(0.f, 0.f, 0.f));
while( ! e->_work->isEmpty() ) {
std::this_thread::yield();
}
}