Odilitime 5 years ago
parent
commit
030d2d8eef
  1. 2
      src/graphics/components/BoxComponent.cpp
  2. 2
      src/graphics/components/ComponentBuilder.cpp
  3. 2
      src/graphics/components/InputComponent.cpp
  4. 4
      src/graphics/components/TextComponent.cpp
  5. 4
      src/graphics/components/TextComponent.h
  6. 14
      src/graphics/opengl/Window.cpp
  7. 2
      src/graphics/text/TextRasterizer.cpp
  8. 8
      src/graphics/text/TextRasterizer.h

2
src/graphics/components/BoxComponent.cpp

@ -107,7 +107,7 @@ BoxComponent::~BoxComponent() { @@ -107,7 +107,7 @@ BoxComponent::~BoxComponent() {
void BoxComponent::render() {
//std::cout << "BoxComponent::render" << std::endl;
int glErr=glGetError();
GLenum glErr=glGetError();
if(glErr != GL_NO_ERROR) {
std::cout << "BoxComponent::render - start not ok: " << glErr << std::endl;
}

2
src/graphics/components/ComponentBuilder.cpp

@ -65,7 +65,7 @@ std::shared_ptr<Component> ComponentBuilder::build(const std::shared_ptr<Node> n @@ -65,7 +65,7 @@ std::shared_ptr<Component> ComponentBuilder::build(const std::shared_ptr<Node> n
// so if y=640 , f(y)=-640
int ny = -y;
std::cout << "TextSelection adjusted " << x << "," << ny << std::endl;
std::cout << "Component at " << (int)component->x << "," << (int)component->y << std::endl;
std::cout << "Component at " << static_cast<int>(component->x) << "," << static_cast<int>(component->y) << std::endl;
};
component->onMouseup = [component](int x, int y) {
std::cout << "TextSelection ending at " << x << "," << y << std::endl;

2
src/graphics/components/InputComponent.cpp

@ -86,7 +86,7 @@ InputComponent::InputComponent(const float rawX, const float rawY, const float r @@ -86,7 +86,7 @@ InputComponent::InputComponent(const float rawX, const float rawY, const float r
void InputComponent::render() {
//std::cout << "InputComponent::render" << std::endl;
int glErr=glGetError();
GLenum glErr=glGetError();
if(glErr != GL_NO_ERROR) {
std::cout << "InputComponent::render - start not ok: " << glErr << std::endl;
}

4
src/graphics/components/TextComponent.cpp

@ -192,8 +192,8 @@ void TextComponent::rasterize(const int rawX, const int rawY) { @@ -192,8 +192,8 @@ void TextComponent::rasterize(const int rawX, const int rawY) {
glyphVertices.push_back(std::move(vertices));
//std::cout << "TextComponent::rasterize - glyphVertices count: " << glyphVertices.size() << std::endl;
textureWidth = response->textureWidth;
textureHeight = response->textureHeight;
textureWidth = static_cast<GLsizei>(response->textureWidth);
textureHeight = static_cast<GLsizei>(response->textureHeight);
textureData = std::move(response->textureData);
//}
//const std::clock_t end = clock();

4
src/graphics/components/TextComponent.h

@ -37,8 +37,8 @@ public: @@ -37,8 +37,8 @@ public:
bool noWrap = false; // different than overflow but related
int availableWidth = 0;
int textureWidth;
int textureHeight;
GLsizei textureWidth;
GLsizei textureHeight;
std::unique_ptr<unsigned char[]> textureData;
// backgroundColor

14
src/graphics/opengl/Window.cpp

@ -37,7 +37,7 @@ bool Window::init() { @@ -37,7 +37,7 @@ bool Window::init() {
return false;
}
initGL();
int glErr=glGetError();
GLenum glErr=glGetError();
if(glErr != GL_NO_ERROR) {
std::cout << "window::init - post initGL - not ok: " << glErr << std::endl;
}
@ -320,7 +320,7 @@ bool Window::initGL() { @@ -320,7 +320,7 @@ bool Window::initGL() {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
int glErr=glGetError();
GLenum glErr=glGetError();
if(glErr != GL_NO_ERROR) {
std::cout << "window::initGL - blend, clear, texParam - not ok: " << glErr << std::endl;
}
@ -355,7 +355,7 @@ GLuint Window::compileShader(const GLenum shaderType, const char *shaderSource) @@ -355,7 +355,7 @@ GLuint Window::compileShader(const GLenum shaderType, const char *shaderSource)
glShaderSource(shader, 1, &shaderSource, nullptr);
glCompileShader(shader);
int glErr=glGetError();
GLenum glErr=glGetError();
if(glErr != GL_NO_ERROR) {
std::cout << "window::compileShader - compileShader - not ok: " << glErr << std::endl;
}
@ -377,7 +377,7 @@ GLuint Window::compileProgram(const GLuint vertexShader, const GLuint fragmentSh @@ -377,7 +377,7 @@ GLuint Window::compileProgram(const GLuint vertexShader, const GLuint fragmentSh
glAttachShader(program, fragmentShader);
glLinkProgram(program);
int glErr=glGetError();
GLenum glErr=glGetError();
if(glErr != GL_NO_ERROR) {
std::cout << "window::compileProgram - glLinkProgram - not ok: " << glErr << std::endl;
}
@ -451,7 +451,7 @@ void Window::render() { @@ -451,7 +451,7 @@ void Window::render() {
if (renderDirty || transformMatrixDirty) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
int glErr=glGetError();
GLenum glErr=glGetError();
if(glErr != GL_NO_ERROR) {
std::cout << "window::render - box render start - not ok: " << glErr << std::endl;
}
@ -589,7 +589,7 @@ void Window::renderBoxComponents(std::shared_ptr<Component> component) { @@ -589,7 +589,7 @@ void Window::renderBoxComponents(std::shared_ptr<Component> component) {
//inputComponent->render();
if (boxComponent) {
/*
int glErr=glGetError();
GLenum glErr=glGetError();
if(glErr != GL_NO_ERROR) {
std::cout << "Window::renderBoxComponents - box render start - not ok: " << glErr << std::endl;
}
@ -635,7 +635,7 @@ void Window::renderComponents(std::shared_ptr<Component> component) { @@ -635,7 +635,7 @@ void Window::renderComponents(std::shared_ptr<Component> component) {
BoxComponent *boxComponent = dynamic_cast<BoxComponent*>(component.get());
//inputComponent->render();
if (boxComponent) {
int glErr=glGetError();
GLenum glErr=glGetError();
if(glErr != GL_NO_ERROR) {
std::cout << "box render start - not ok: " << glErr << std::endl;
}

2
src/graphics/text/TextRasterizer.cpp

@ -364,7 +364,7 @@ std::unique_ptr<rasterizationResponse> TextRasterizer::rasterize(const rasteriza @@ -364,7 +364,7 @@ std::unique_ptr<rasterizationResponse> TextRasterizer::rasterize(const rasteriza
// source is 0 to (0:iy:rows)
// dest is cx+bl, (0:iy:rows)+(0:cy:height)+bump
//std::cout << "placing glyph row at " << (cx + slot->bitmap_left) << "x" << ((iy + cy) + bump) << std::endl;
unsigned int destPos = (cx - request.sourceStartX + leftPadding + slot->bitmap_left) + ((iy + static_cast<unsigned int>(cy - request.sourceStartY)) + static_cast<unsigned int>(bump)) * static_cast<unsigned int>(response->textureWidth);
unsigned int destPos = static_cast<unsigned int>(cx - request.sourceStartX + leftPadding + slot->bitmap_left) + ((iy + static_cast<unsigned int>(cy - request.sourceStartY)) + static_cast<unsigned int>(bump)) * response->textureWidth;
if (destPos >= size) {
// we're done with this line
continue;

8
src/graphics/text/TextRasterizer.h

@ -16,8 +16,8 @@ struct Glyph { @@ -16,8 +16,8 @@ struct Glyph {
float t0;
float s1;
float t1;
int textureWidth;
int textureHeight;
unsigned int textureWidth;
unsigned int textureHeight;
std::unique_ptr<unsigned char[]> textureData;
};
@ -55,8 +55,8 @@ struct rasterizationResponse { @@ -55,8 +55,8 @@ struct rasterizationResponse {
float t0;
float s1; // calculated on other members here
float t1; // calculated on other members here
int textureWidth;
int textureHeight;
unsigned int textureWidth;
unsigned int textureHeight;
std::unique_ptr<unsigned char[]> textureData;
};

Loading…
Cancel
Save