Small updates from the past (for consistency)

master
Vectozavr 2023-05-19 14:35:47 +03:00
parent 07cab50b6e
commit b3d43c301b
3 changed files with 22 additions and 7 deletions

View File

@ -39,6 +39,7 @@ namespace ShooterConsts {
const std::string CUBE_OBJ = "obj/other/cube.obj";
const std::string MAP_OBJ = "obj/maps/map1.obj";
const std::string MAR_RAILWAY_OBJ = "obj/maps/railway.obj";
const std::string BIG_MAP_OBJ = "obj/maps/map2.obj";
const std::string SIMPLE_MAP_OBJ = "obj/maps/map_simple.obj";
const std::string PLANE_MAP_OBJ = "obj/maps/plane.obj";

View File

@ -12,7 +12,7 @@ int main() {
// Optimal for standard monitors:
//game.create(720, 480, ShooterConsts::PROJECT_NAME, true);
game.create(1280, 720, ShooterConsts::PROJECT_NAME, true);
game.create(1920, 1080, ShooterConsts::PROJECT_NAME, true);
//game.create(1920, 1080, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen);
// Optimal for MacBook Pro 16 display:

View File

@ -97,7 +97,21 @@ void Screen::drawTriangle(const Triangle &triangle) {
triangle.color())
};
_window->draw(tris, 3, sf::Triangles);
sf::Vertex lines[4] =
{
sf::Vertex(sf::Vector2f(triangle[0].x(), triangle[0].y()), sf::Color(0, 0, 0, 255)),
sf::Vertex(sf::Vector2f(triangle[1].x(), triangle[1].y()), sf::Color(0, 0, 0, 255)),
sf::Vertex(sf::Vector2f(triangle[2].x(), triangle[2].y()), sf::Color(0, 0, 0, 255)),
sf::Vertex(sf::Vector2f(triangle[0].x(), triangle[0].y()), sf::Color(0, 0, 0, 255))
};
// Uncomment this line to show boundaries of triangles
// Раскомментируйте эту строку для отображения границ треугольников
// |
// \/
_window->draw(lines, 4, sf::LineStrip);
//_window->draw(tris, 3, sf::Triangles);
}
void Screen::setTitle(const std::string &title) {
@ -167,11 +181,11 @@ void Screen::prepareToGlDrawMesh() {
glDisable(GL_LIGHTING);
// enable alpha channel:
//glEnable( GL_ALPHA_TEST );
//glAlphaFunc(GL_NOTEQUAL, 0.0);
//
//glEnable(GL_BLEND);
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable( GL_ALPHA_TEST );
glAlphaFunc(GL_NOTEQUAL, 0.0);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// Configure the viewport (the same size as the window)
glViewport(0, 0, _window->getSize().x, _window->getSize().y);