Browse Source

Use make_unique

pull/1/head
gyroninja 5 years ago
parent
commit
8eceeab56b
  1. 2
      src/graphics/text/TextRasterizer.cpp
  2. 6
      src/main.cpp

2
src/graphics/text/TextRasterizer.cpp

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
TextRasterizer::TextRasterizer(std::string fontPath, int size, int resolution) {
FT_Init_FreeType(&lib);
face = std::unique_ptr<FT_Face>(new FT_Face);
face = std::make_unique<FT_Face>();
if (FT_New_Face(lib, fontPath.c_str(), 0, face.get())) {
std::cout << "Could not open font" << std::endl;
return;

6
src/main.cpp

@ -56,9 +56,9 @@ int main(int argc, char *argv[]) { @@ -56,9 +56,9 @@ int main(int argc, char *argv[]) {
std::cout << "./netrunner <url>" << std::endl;
return 1;
}
// std::unique_ptr<HTTPRequest> request = std::unique_ptr<HTTPRequest>(new HTTPRequest(getHostFromURL(argv[1]), getDocumentFromURL(argv[1])));
// request->sendRequest(handleRequest);
std::unique_ptr<Window> window = std::unique_ptr<Window>(new Window());
std::unique_ptr<HTTPRequest> request = std::unique_ptr<HTTPRequest>(new HTTPRequest(getHostFromURL(argv[1]), getDocumentFromURL(argv[1])));
request->sendRequest(handleRequest);
std::unique_ptr<Window> window = std::make_unique<Window>();
window->init();
while (!glfwWindowShouldClose(window->window)) {
window->render();

Loading…
Cancel
Save