Browse Source

requested code clean up

pull/1/head
Odilitime 3 years ago
parent
commit
4b93f59d05
4 changed files with 9 additions and 6 deletions
  1. 2
    2
      README.md
  2. 4
    1
      cr
  3. 1
    1
      src/graphics/components/TextComponent.cpp
  4. 2
    2
      src/graphics/components/TextComponent.h

+ 2
- 2
README.md View File

@@ -1,8 +1,8 @@
# Netrunner

is an implementation of a new web browser written in C++ utilizing OpenGL. This is a new brand engine.
is an implementation of a new web browser written in C++ utilizing OpenGL. This is a brand new engine.

Status: You can give it a url and it'll download, parser, and render the text to framebuffer
Status: You can give it a url and it'll download, parser, and render the text from the page

## Odili's vision
A modern web browser is a huge project. I'd like to see this broken into several composeable pieces.

+ 4
- 1
cr View File

@@ -1,2 +1,5 @@
#!/bin/bash
make -j$(nproc) && ./netrunner http://motherfuckingwebsite.com/
physicalCpuCount=$([[ $(uname) = 'Darwin' ]] &&
sysctl -n hw.physicalcpu_max ||
lscpu -p | egrep -v '^#' | sort -u -t, -k 2,4 | wc -l)
make -j$physicalCpuCount && ./netrunner http://motherfuckingwebsite.com/

+ 1
- 1
src/graphics/components/TextComponent.cpp View File

@@ -69,7 +69,7 @@ TextComponent::~TextComponent() {
}
}

#define posMac(p) p*9
#define posMac(p) p*9 // 9 floats = 3 positions + 4 color channels + 2 S&T (texture mapping)

inline void setVertices(std::unique_ptr<float[]> &vertices, int p, unsigned int color) {
vertices[posMac(p) + 2] = 0.0f;

+ 2
- 2
src/graphics/components/TextComponent.h View File

@@ -21,7 +21,7 @@ private:
};
//std::vector <Glyph> *glyphs;
std::unique_ptr<const Glyph[]> glyphs;
std::vector<std::unique_ptr<float[]> > glyphVertices;
std::vector<std::unique_ptr<float[]>> glyphVertices;
std::vector<GLuint> vertexArrayObjects;
std::vector<GLuint> vertexBufferObjects;
GLuint elementBufferObject;
@@ -37,4 +37,4 @@ public:
void sanitize(std::string &str);
};

#endif
#endif

Loading…
Cancel
Save