Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ogoregen/flyGL
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.1
Choose a base ref
...
head repository: ogoregen/flyGL
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Feb 7, 2020

  1. added releases link

    ogoregen authored Feb 7, 2020
    Copy the full SHA
    0bfe002 View commit details
  2. applied updates

    ogoregen authored Feb 7, 2020
    Copy the full SHA
    19d8298 View commit details
  3. updated description

    ogoregen authored Feb 7, 2020
    Copy the full SHA
    597bc96 View commit details
  4. minor

    ogoregen authored Feb 7, 2020
    Copy the full SHA
    359f374 View commit details
  5. Copy the full SHA
    0ef5dda View commit details
  6. updated feature list

    ogoregen authored Feb 7, 2020
    Copy the full SHA
    da3e55c View commit details
  7. added usage section

    ogoregen authored Feb 7, 2020
    Copy the full SHA
    3a9d613 View commit details

Commits on Feb 8, 2020

  1. added rotation

    ogoregen authored Feb 8, 2020
    Copy the full SHA
    864ee3d View commit details
  2. added fullscreen toggle

    ogoregen authored Feb 8, 2020
    Copy the full SHA
    c39b3cb View commit details
  3. updated feature list

    ogoregen authored Feb 8, 2020
    Copy the full SHA
    3465317 View commit details
  4. Copy the full SHA
    647a0cf View commit details
  5. added namespace

    ogoregen authored Feb 8, 2020
    Copy the full SHA
    fddb763 View commit details
  6. updated feature list

    ogoregen authored Feb 8, 2020
    Copy the full SHA
    8308410 View commit details
  7. added comment

    ogoregen authored Feb 8, 2020
    Copy the full SHA
    f8f078e View commit details

Commits on Feb 10, 2020

  1. changed file name back

    ogoregen authored Feb 10, 2020
    Copy the full SHA
    788c50d View commit details

Commits on Feb 14, 2020

  1. updated usage

    ogoregen authored Feb 14, 2020
    Copy the full SHA
    cef4213 View commit details

Commits on Feb 15, 2020

  1. updated usage

    ogoregen authored Feb 15, 2020
    Copy the full SHA
    4e39a37 View commit details
  2. minor

    ogoregen authored Feb 15, 2020
    Copy the full SHA
    a06b1e6 View commit details
  3. minor

    ogoregen authored Feb 15, 2020
    Copy the full SHA
    5fb83bf View commit details

Commits on Apr 5, 2020

  1. minor

    ogoregen authored Apr 5, 2020
    Copy the full SHA
    09d8d57 View commit details

Commits on Jun 26, 2020

  1. minor

    ogoregen authored Jun 26, 2020
    Copy the full SHA
    f4abdbe View commit details
  2. minor

    ogoregen authored Jun 26, 2020
    Copy the full SHA
    435c129 View commit details
  3. minor

    ogoregen authored Jun 26, 2020
    Copy the full SHA
    5cbe99c View commit details

Commits on Jul 1, 2020

  1. minor

    ogoregen authored Jul 1, 2020
    Copy the full SHA
    1254743 View commit details
  2. minor

    ogoregen authored Jul 1, 2020
    Copy the full SHA
    9fc9f58 View commit details
  3. minor stylistic change

    ogoregen authored Jul 1, 2020
    Copy the full SHA
    0b6b55a View commit details

Commits on Jul 23, 2020

  1. added license

    ogoregen authored Jul 23, 2020
    Copy the full SHA
    96bf413 View commit details

Commits on Mar 30, 2021

  1. created directory src

    ogoregen authored Mar 30, 2021
    Copy the full SHA
    53cefde View commit details

Commits on Apr 14, 2021

  1. Delete src directory

    ogoregen authored Apr 14, 2021
    Copy the full SHA
    494ff45 View commit details

Commits on May 15, 2021

  1. Refactor file structure

    ogoregen committed May 15, 2021
    Copy the full SHA
    46a0348 View commit details

Commits on May 27, 2021

  1. Update README.md

    ogoregen authored May 27, 2021
    Copy the full SHA
    1602040 View commit details
Showing with 581 additions and 530 deletions.
  1. +21 −0 LICENSE
  2. +18 −0 README.md
  3. +16 −10 examples/parallelogram.cpp
  4. +0 −14 readme.md
  5. +14 −10 { → src}/fly-utility.h
  6. +495 −479 { → src}/fly.h
  7. +17 −17 { → src}/shaders/fragment.shader
  8. 0 { → src}/shaders/vertex.shader
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 flighty.xyz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
A simple Object Oriented C++ OpenGL wrapper library inspired by [Processing](https://processing.org).

## Features
* orthographic and perspective projection
* window handling
* complete matrix handling
* 2D textures
* instancing

Check [examples](https://github.com/flightcoded/fly-graphics/tree/master/examples).

## Dependencies
* [GLAD](https://glad.dav1d.de) (configured for OpenGL 3.3 Core)
* [GLFW](https://www.glfw.org)
* [GLM](https://github.com/g-truc/glm)
* [stb_image](https://github.com/nothings/stb/blob/master/stb_image.h)

There is a complete Visual Studio project with all dependencies linked and included under [releases](https://github.com/flightcoded/fly-graphics/releases). Feel free to create an issue or contact me should you find an error or just want to.
26 changes: 16 additions & 10 deletions examples/parallelogram.cpp
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@

#include "fly.h"
//a rotating 2D parallelogram

#include "fly/fly.h"

int main(){

fly::createWindow("parallelogram", 800, 600);
fly::initialize(fly::projectionMethod::ORTHO);

float vertices[] = {
//x, y, z, s, t
-100, -50, 0, 0, 1,
0, 50, 0, 0, 0,
100, 50, 0, 1, 0,
0, -50, 0, 1, 1
//x, y, z
-100, -50, 0,
0, 50, 0,
100, 50, 0,
0, -50, 0
};

unsigned int indices[] = {
unsigned int indices[] = { //vertex draw order, as two triangles

0, 1, 3,
3, 1, 2
};

fly::Thing parallelogram;
parallelogram.initialize(vertices, sizeof(vertices), indices, sizeof(indices));

fly::fill(1, 0.5, 0.5);
parallelogram.initialize(vertices, sizeof(vertices), indices, sizeof(indices), true);

fly::fill(82, 9, 91); //rgb

float angle = 0;

for(; fly::running(); fly::update()){

fly::translate(fly::width/2, fly::height/2);
fly::rotate(0, 0, angle);
parallelogram.display();
angle++;
}

fly::terminate();
14 changes: 0 additions & 14 deletions readme.md

This file was deleted.

24 changes: 14 additions & 10 deletions fly-utility.h → src/fly-utility.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@

#pragma once

double map(double x, double r1, double r2, double a1, double a2){

double p = (r2 - r1) / (x - r1);
double y = ((a2 - a1) / p) + a1;
return y;
}


#pragma once

namespace fly{

double map(double x, double r1, double r2, double a1, double a2){

double p = (r2 - r1) / (x - r1);
double y = ((a2 - a1) / p) + a1;
return y;
}

}

974 changes: 495 additions & 479 deletions fly.h → src/fly.h

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions shaders/fragment.shader → src/shaders/fragment.shader
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

#version 330 core

out vec4 FragColor;

in vec2 textureC;

uniform sampler2D textureSampler;
uniform vec4 fillColor;
uniform bool usingTexture;

void main(){

if(usingTexture) FragColor = texture(textureSampler, textureC);
else FragColor = vec4(fillColor);
}


#version 330 core

out vec4 FragColor;

in vec2 textureC;

uniform sampler2D textureSampler;
uniform vec4 fillColor;
uniform bool usingTexture;

void main(){

if(usingTexture) FragColor = texture(textureSampler, textureC);
else FragColor = vec4(fillColor);
}

File renamed without changes.