Add fontawesome icons

+ Clean up resource prefixes
This commit is contained in:
Shaun Reed 2023-01-01 23:33:39 -05:00
parent 85c9e2eac1
commit f83f68207d
16 changed files with 281 additions and 128 deletions

View File

@ -1,81 +0,0 @@
<RCC>
<qresource prefix="/">
<!--3DModel test shader-->
<file alias="model.frag">resources/shaders/fragment/model.frag</file>
<file alias="model.vert">resources/shaders/vertex/model.vert</file>
<!--Phong test shader-->
<file alias="phong.frag">resources/shaders/fragment/phong.frag</file>
<file alias="phong.vert">resources/shaders/vertex/phong.vert</file>
<!--Simple Solid Shader-->
<file alias="solid.frag">resources/shaders/fragment/solid.frag</file>
<file alias="solid.vert">resources/shaders/vertex/solid.vert</file>
<!--Solid Color Shader-->
<file alias="solid-perspective.frag">resources/shaders/fragment/solid-perspective.frag</file>
<file alias="solid-perspective.vert">resources/shaders/vertex/solid-perspective.vert</file>
<!--Multi-color Shader-->
<file alias="multi-color.frag">resources/shaders/fragment/multi-color.frag</file>
<file alias="multi-color.vert">resources/shaders/vertex/multi-color.vert</file>
<!--RGB Normals Shader-->
<file alias="rgb-normals.frag">resources/shaders/fragment/rgb-normals.frag</file>
<file alias="rgb-normals.vert">resources/shaders/vertex/rgb-normals.vert</file>
<!--CubeMap Texture Shader-->
<file alias="texture-cubemap.frag">resources/shaders/fragment/texture-cubemap.frag</file>
<file alias="texture-cubemap.vert">resources/shaders/vertex/texture-cubemap.vert</file>
<!--2D Texture Shader-->
<file alias="texture2d.frag">resources/shaders/fragment/texture2d.frag</file>
<file alias="texture2d.vert">resources/shaders/vertex/texture2d.vert</file>
<!--Ambient Shader-->
<file alias="solid-ambient.frag">resources/shaders/fragment/solid-ambient.frag</file>
<file alias="solid-ambient.vert">resources/shaders/vertex/solid-ambient.vert</file>
<!--Diffuse Shader-->
<file alias="solid-diffuse.frag">resources/shaders/fragment/solid-diffuse.frag</file>
<file alias="solid-diffuse.vert">resources/shaders/vertex/solid-diffuse.vert</file>
<!--Specular Shader-->
<file alias="solid-specular.frag">resources/shaders/fragment/solid-specular.frag</file>
<file alias="solid-specular.vert">resources/shaders/vertex/solid-specular.vert</file>
<!--Basic Phong Shader-->
<file alias="solid-phong.frag">resources/shaders/fragment/solid-phong.frag</file>
<file alias="solid-phong.vert">resources/shaders/vertex/solid-phong.vert</file>
<!--3DModel Basic Shader-->
<file alias="model-basic.frag">resources/shaders/fragment/model-basic.frag</file>
<file alias="model-basic.vert">resources/shaders/vertex/model-basic.vert</file>
<!--3DModel shader with specular mapping-->
<file alias="model-specular.frag">resources/shaders/fragment/model-specular.frag</file>
<file alias="model-specular.vert">resources/shaders/vertex/model-specular.vert</file>
<!--3DModel shader with normal mapping-->
<file alias="model-normals.frag">resources/shaders/fragment/model-normals.frag</file>
<file alias="model-normals.vert">resources/shaders/vertex/model-normals.vert</file>
<!-- Skybox Shaders-->
<file alias="skybox.frag">resources/skybox/skybox.frag</file>
<file alias="skybox.vert">resources/skybox/skybox.vert</file>
<!--Texture Images-->
<file alias="crate.png">resources/images/crate.png</file>
<file alias="stone.png">resources/images/stone.png</file>
<file alias="wood.png">resources/images/wood.png</file>
<!-- Skybox Images-->
<file alias="back.png">resources/skybox/back.png</file>
<file alias="bottom.png">resources/skybox/bottom.png</file>
<file alias="front.png">resources/skybox/front.png</file>
<file alias="left.png">resources/skybox/left.png</file>
<file alias="right.png">resources/skybox/right.png</file>
<file alias="top.png">resources/skybox/top.png</file>
</qresource>
</RCC>

View File

@ -0,0 +1,165 @@
Fonticons, Inc. (https://fontawesome.com)
--------------------------------------------------------------------------------
Font Awesome Free License
Font Awesome Free is free, open source, and GPL friendly. You can use it for
commercial projects, open source projects, or really almost whatever you want.
Full Font Awesome Free license: https://fontawesome.com/license/free.
--------------------------------------------------------------------------------
# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
The Font Awesome Free download is licensed under a Creative Commons
Attribution 4.0 International License and applies to all icons packaged
as SVG and JS file types.
--------------------------------------------------------------------------------
# Fonts: SIL OFL 1.1 License
In the Font Awesome Free download, the SIL OFL license applies to all icons
packaged as web and desktop font files.
Copyright (c) 2022 Fonticons, Inc. (https://fontawesome.com)
with Reserved Font Name: "Font Awesome".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
SIL OPEN FONT LICENSE
Version 1.1 - 26 February 2007
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting — in part or in whole — any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
--------------------------------------------------------------------------------
# Code: MIT License (https://opensource.org/licenses/MIT)
In the Font Awesome Free download, the MIT license applies to all non-font and
non-icon files.
Copyright 2022 Fonticons, Inc.
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.
--------------------------------------------------------------------------------
# Attribution
Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
Awesome Free files already contain embedded comments with sufficient
attribution, so you shouldn't need to do anything additional when using these
files normally.
We've kept attribution comments terse, so we ask that you do not actively work
to remove them from files, especially code. They're a great way for folks to
learn about Font Awesome.
--------------------------------------------------------------------------------
# Brand Icons
All brand icons are trademarks of their respective owners. The use of these
trademarks does not indicate endorsement of the trademark holder by Font
Awesome, nor vice versa. **Please do not use brand logos for any purpose except
to represent the company, product, or service to which they refer.**

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M439.55 236.05L244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>

After

Width:  |  Height:  |  Size: 749 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M224 256c-35.2 0-64 28.8-64 64c0 35.2 28.8 64 64 64c35.2 0 64-28.8 64-64C288 284.8 259.2 256 224 256zM433.1 129.1l-83.9-83.9C341.1 37.06 328.8 32 316.1 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V163.9C448 151.2 442.9 138.9 433.1 129.1zM128 80h144V160H128V80zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h16v104c0 13.25 10.75 24 24 24h192C309.3 208 320 197.3 320 184V83.88l78.25 78.25C399.4 163.2 400 164.8 400 166.3V416z"/></svg>

After

Width:  |  Height:  |  Size: 789 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M572.6 270.3l-96 192C471.2 473.2 460.1 480 447.1 480H64c-35.35 0-64-28.66-64-64V96c0-35.34 28.65-64 64-64h117.5c16.97 0 33.25 6.742 45.26 18.75L275.9 96H416c35.35 0 64 28.66 64 64v32h-48V160c0-8.824-7.178-16-16-16H256L192.8 84.69C189.8 81.66 185.8 80 181.5 80H64C55.18 80 48 87.18 48 96v288l71.16-142.3C124.6 230.8 135.7 224 147.8 224h396.2C567.7 224 583.2 249 572.6 270.3z"/></svg>

After

Width:  |  Height:  |  Size: 664 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M160 400C160 408.8 152.8 416 144 416C135.2 416 128 408.8 128 400V192C128 183.2 135.2 176 144 176C152.8 176 160 183.2 160 192V400zM240 400C240 408.8 232.8 416 224 416C215.2 416 208 408.8 208 400V192C208 183.2 215.2 176 224 176C232.8 176 240 183.2 240 192V400zM320 400C320 408.8 312.8 416 304 416C295.2 416 288 408.8 288 400V192C288 183.2 295.2 176 304 176C312.8 176 320 183.2 320 192V400zM317.5 24.94L354.2 80H424C437.3 80 448 90.75 448 104C448 117.3 437.3 128 424 128H416V432C416 476.2 380.2 512 336 512H112C67.82 512 32 476.2 32 432V128H24C10.75 128 0 117.3 0 104C0 90.75 10.75 80 24 80H93.82L130.5 24.94C140.9 9.357 158.4 0 177.1 0H270.9C289.6 0 307.1 9.358 317.5 24.94H317.5zM151.5 80H296.5L277.5 51.56C276 49.34 273.5 48 270.9 48H177.1C174.5 48 171.1 49.34 170.5 51.56L151.5 80zM80 432C80 449.7 94.33 464 112 464H336C353.7 464 368 449.7 368 432V128H80V432z"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M234.5 5.7c13.9-5 29.1-5 43.1 0l192 68.6C495 83.4 512 107.5 512 134.6V377.4c0 27-17 51.2-42.5 60.3l-192 68.6c-13.9 5-29.1 5-43.1 0l-192-68.6C17 428.6 0 404.5 0 377.4V134.6c0-27 17-51.2 42.5-60.3l192-68.6zM256 66L82.3 128 256 190l173.7-62L256 66zm32 368.6l160-57.1v-188L288 246.6v188z"/></svg>

After

Width:  |  Height:  |  Size: 574 B

55
resources/resources.qrc Normal file
View File

@ -0,0 +1,55 @@
<RCC>
<qresource prefix="/textures">
<file alias="crate.png">images/crate.png</file>
<file alias="stone.png">images/stone.png</file>
<file alias="wood.png">images/wood.png</file>
<file>skybox/back.png</file>
<file>skybox/bottom.png</file>
<file>skybox/front.png</file>
<file>skybox/left.png</file>
<file>skybox/right.png</file>
<file>skybox/top.png</file>
</qresource>
<qresource prefix="/icons">
<file>fontawesome-free-6.2.1-desktop/svgs/solid/cube.svg</file>
<file>fontawesome-free-6.2.1-desktop/svgs/regular/trash-can.svg</file>
<file>fontawesome-free-6.2.1-desktop/svgs/regular/folder-open.svg</file>
<file>fontawesome-free-6.2.1-desktop/svgs/regular/floppy-disk.svg</file>
<file>fontawesome-free-6.2.1-desktop/svgs/brands/git-alt.svg</file>
<file>icon.png</file>
</qresource>
<qresource prefix="/shaders">
<file alias="model.frag">shaders/fragment/model.frag</file>
<file alias="model.vert">shaders/vertex/model.vert</file>
<file alias="phong.frag">shaders/fragment/phong.frag</file>
<file alias="phong.vert">shaders/vertex/phong.vert</file>
<file alias="solid.frag">shaders/fragment/solid.frag</file>
<file alias="solid.vert">shaders/vertex/solid.vert</file>
<file alias="solid-perspective.frag">shaders/fragment/solid-perspective.frag</file>
<file alias="solid-perspective.vert">shaders/vertex/solid-perspective.vert</file>
<file alias="multi-color.frag">shaders/fragment/multi-color.frag</file>
<file alias="multi-color.vert">shaders/vertex/multi-color.vert</file>
<file alias="rgb-normals.frag">shaders/fragment/rgb-normals.frag</file>
<file alias="rgb-normals.vert">shaders/vertex/rgb-normals.vert</file>
<file alias="texture-cubemap.frag">shaders/fragment/texture-cubemap.frag</file>
<file alias="texture-cubemap.vert">shaders/vertex/texture-cubemap.vert</file>
<file alias="texture2d.frag">shaders/fragment/texture2d.frag</file>
<file alias="texture2d.vert">shaders/vertex/texture2d.vert</file>
<file alias="solid-ambient.frag">shaders/fragment/solid-ambient.frag</file>
<file alias="solid-ambient.vert">shaders/vertex/solid-ambient.vert</file>
<file alias="solid-diffuse.frag">shaders/fragment/solid-diffuse.frag</file>
<file alias="solid-diffuse.vert">shaders/vertex/solid-diffuse.vert</file>
<file alias="solid-specular.frag">shaders/fragment/solid-specular.frag</file>
<file alias="solid-specular.vert">shaders/vertex/solid-specular.vert</file>
<file alias="solid-phong.frag">shaders/fragment/solid-phong.frag</file>
<file alias="solid-phong.vert">shaders/vertex/solid-phong.vert</file>
<file alias="model-basic.frag">shaders/fragment/model-basic.frag</file>
<file alias="model-basic.vert">shaders/vertex/model-basic.vert</file>
<file alias="model-specular.frag">shaders/fragment/model-specular.frag</file>
<file alias="model-specular.vert">shaders/vertex/model-specular.vert</file>
<file alias="model-normals.frag">shaders/fragment/model-normals.frag</file>
<file alias="model-normals.vert">shaders/vertex/model-normals.vert</file>
<file alias="skybox.frag">skybox/skybox.frag</file>
<file alias="skybox.vert">skybox/skybox.vert</file>
</qresource>
</RCC>

View File

@ -69,7 +69,7 @@ set(QTK_APP_SOURCES
qtkmainwindow.h
main.cpp
)
qt6_add_resources(QTK_APP_SOURCES ${CMAKE_SOURCE_DIR}/resources.qrc)
qt6_add_resources(QTK_APP_SOURCES ${CMAKE_SOURCE_DIR}/resources/resources.qrc)
configure_file(
"resources.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/resources.h"

View File

@ -120,7 +120,8 @@ void ExampleScene::init() {
// NOTE: You no longer need to manually bind shader program to set uniforms.
// + You can still bind it if you want to for performance reasons.
// + Qtk will only bind / release if the shader program is not already bound.
mTestPhong->setShaders(":/solid-phong.vert", ":/solid-phong.frag");
mTestPhong->setShaders(
":/shaders/solid-phong.vert", ":/shaders/solid-phong.frag");
// For example this would technically not be efficient, because each one of
// these calls will bind, set, release. We could instead bind, set N uniforms,
@ -146,14 +147,16 @@ void ExampleScene::init() {
/* Example of a cube with no lighting applied */
mesh = addObject(new Qtk::MeshRenderer("noLight", Cube(QTK_DRAW_ELEMENTS)));
mesh->getTransform().setTranslation(5.0f, 0.0f, -2.0f);
mesh->setShaders(":/solid-perspective.vert", ":/solid-perspective.frag");
mesh->setShaders(
":/shaders/solid-perspective.vert", ":/shaders/solid-perspective.frag");
mesh->setUniform("uColor", QVector3D(0.0f, 0.25f, 0.0f));
// No light source needed for this lighting technique
/* Initialize Ambient example cube */
mTestAmbient = new Qtk::MeshRenderer("ambient", Cube());
mTestAmbient->getTransform().setTranslation(7.0f, 0.0f, -2.0f);
mTestAmbient->setShaders(":/solid-ambient.vert", ":/solid-ambient.frag");
mTestAmbient->setShaders(
":/shaders/solid-ambient.vert", ":/shaders/solid-ambient.frag");
// Changing these uniform values will alter lighting effects.
mTestAmbient->setUniform("uColor", QVector3D(0.0f, 0.25f, 0.0f));
mTestAmbient->setUniform("uLightColor", QVector3D(1.0f, 1.0f, 1.0f));
@ -164,7 +167,8 @@ void ExampleScene::init() {
/* Initialize Diffuse example cube */
mTestDiffuse = new Qtk::MeshRenderer("diffuse", Cube());
mTestDiffuse->getTransform().setTranslation(9.0f, 0.0f, -2.0f);
mTestDiffuse->setShaders(":/solid-diffuse.vert", ":/solid-diffuse.frag");
mTestDiffuse->setShaders(
":/shaders/solid-diffuse.vert", ":/shaders/solid-diffuse.frag");
mTestDiffuse->setUniform("uColor", QVector3D(0.0f, 0.25f, 0.0f));
mTestDiffuse->setUniform("uLightColor", QVector3D(1.0f, 1.0f, 1.0f));
mTestDiffuse->setUniform("uAmbientStrength", 0.2f);
@ -179,7 +183,8 @@ void ExampleScene::init() {
/* Initialize Specular example cube */
mTestSpecular = new Qtk::MeshRenderer("specular", Cube());
mTestSpecular->getTransform().setTranslation(11.0f, 0.0f, -2.0f);
mTestSpecular->setShaders(":/solid-specular.vert", ":/solid-specular.frag");
mTestSpecular->setShaders(
":/shaders/solid-specular.vert", ":/shaders/solid-specular.frag");
mTestSpecular->setUniform("uColor", QVector3D(0.0f, 0.25f, 0.0f));
mTestSpecular->setUniform("uLightColor", QVector3D(1.0f, 1.0f, 1.0f));
mTestSpecular->setUniform("uAmbientStrength", 0.2f);
@ -197,7 +202,7 @@ void ExampleScene::init() {
/* Test basic cube with phong.vert and phong.frag shaders */
mesh = addObject(new Qtk::MeshRenderer("testPhong", Cube(QTK_DRAW_ARRAYS)));
mesh->getTransform().setTranslation(5.0f, 0.0f, 10.0f);
mesh->setShaders(":/phong.vert", ":/phong.frag");
mesh->setShaders(":/shaders/phong.vert", ":/shaders/phong.frag");
// WARNING: Set color before reallocating normals.
mesh->setColor(QVector3D(0.0f, 0.25f, 0.0f));
mesh->reallocateNormals(mesh->getNormals());
@ -229,7 +234,7 @@ void ExampleScene::init() {
/* Test alien Model with phong lighting and specular mapping. */
model = addObject(new Qtk::Model(
"alienTest", PATH("/models/alien-hominid/alien.obj"),
":/model-specular.vert", ":/model-specular.frag"));
":/shaders/model-specular.vert", ":/shaders/model-specular.frag"));
model->getTransform().setTranslation(3.0f, -1.0f, 10.0f);
model->getTransform().scale(0.15f);
model->setUniform("uMaterial.ambient", QVector3D(1.0f, 1.0f, 1.0f));
@ -255,7 +260,7 @@ void ExampleScene::init() {
/* Test spartan Model with phong lighting, specular and normal mapping. */
model = addObject(new Qtk::Model(
"spartanTest", PATH("/models/spartan/spartan.obj"),
":/model-normals.vert", ":/model-normals.frag"));
":/shaders/model-normals.vert", ":/shaders/model-normals.frag"));
model->getTransform().setTranslation(0.0f, -1.0f, 10.0f);
model->getTransform().scale(2.0f);
model->setUniform("uMaterial.ambient", QVector3D(1.0f, 1.0f, 1.0f));
@ -285,22 +290,22 @@ void ExampleScene::init() {
mesh = addObject(
new Qtk::MeshRenderer("rgbNormalsCubeArraysTest", Cube(QTK_DRAW_ARRAYS)));
mesh->getTransform().setTranslation(5.0f, 0.0f, 4.0f);
mesh->setShaders(":/rgb-normals.vert", ":/rgb-normals.frag");
mesh->setShaders(":/shaders/rgb-normals.vert", ":/shaders/rgb-normals.frag");
mesh->reallocateNormals(mesh->getNormals());
// RGB Normals cube to show normals are correct with QTK_DRAW_ELEMENTS_NORMALS
mesh = addObject(new Qtk::MeshRenderer(
"rgbNormalsCubeElementsTest", Cube(QTK_DRAW_ELEMENTS_NORMALS)));
mesh->getTransform().setTranslation(5.0f, 0.0f, 2.0f);
mesh->setShaders(":/rgb-normals.vert", ":/rgb-normals.frag");
mesh->setShaders(":/shaders/rgb-normals.vert", ":/shaders/rgb-normals.frag");
mesh->reallocateNormals(mesh->getNormals());
Texture crateTexture;
crateTexture.setTexture(":/crate.png");
crateTexture.setTexture(":/textures/crate.png");
Cube cube;
auto * m = new MeshRenderer("Test Crate", Cube(QTK_DRAW_ARRAYS));
m->getTransform().setTranslation(0, 0, 13);
m->setShaders(":/texture2d.vert", ":/texture2d.frag");
m->setShaders(":/shaders/texture2d.vert", ":/shaders/texture2d.frag");
m->setTexture(crateTexture);
m->setUniform("uTexture", 0);
m->reallocateTexCoords(cube.getTexCoords());
@ -314,7 +319,7 @@ void ExampleScene::init() {
mesh = addObject(
new Qtk::MeshRenderer("uvCubeArraysTest", Cube(QTK_DRAW_ARRAYS)));
mesh->getTransform().setTranslation(-3.0f, 0.0f, -2.0f);
mesh->setShaders(":/texture2d.vert", ":/texture2d.frag");
mesh->setShaders(":/shaders/texture2d.vert", ":/shaders/texture2d.frag");
mesh->setTexture(crateTexture);
mesh->setUniform("uTexture", 0);
mesh->reallocateTexCoords(mesh->getTexCoords());
@ -323,8 +328,8 @@ void ExampleScene::init() {
mesh = addObject(new Qtk::MeshRenderer(
"uvCubeElementsTest", Cube(QTK_DRAW_ELEMENTS_NORMALS)));
mesh->getTransform().setTranslation(-1.7f, 0.0f, -2.0f);
mesh->setTexture(":/crate.png");
mesh->setShaders(":/texture2d.vert", ":/texture2d.frag");
mesh->setTexture(":/textures/crate.png");
mesh->setShaders(":/shaders/texture2d.vert", ":/shaders/texture2d.frag");
mesh->bindShaders();
mesh->setUniform("uTexture", 0);
mesh->reallocateNormals(mesh->getNormals());
@ -338,8 +343,9 @@ void ExampleScene::init() {
addObject(new Qtk::MeshRenderer("testCubeMap", Cube(QTK_DRAW_ELEMENTS)));
mesh->getTransform().setTranslation(-3.0f, 1.0f, -2.0f);
mesh->getTransform().setRotation(45.0f, 0.0f, 1.0f, 0.0f);
mesh->setShaders(":/texture-cubemap.vert", ":/texture-cubemap.frag");
mesh->setCubeMap(":/crate.png");
mesh->setShaders(
":/shaders/texture-cubemap.vert", ":/shaders/texture-cubemap.frag");
mesh->setCubeMap(":/textures/crate.png");
mesh->setUniform("uTexture", 0);
mesh->reallocateTexCoords(mesh->getTexCoords());
@ -348,30 +354,30 @@ void ExampleScene::init() {
mesh =
addObject(new Qtk::MeshRenderer("rgbNormalsCube", Cube(QTK_DRAW_ARRAYS)));
mesh->getTransform().setTranslation(5.0f, 2.0f, -2.0f);
mesh->setShaders(":/rgb-normals.vert", ":/rgb-normals.frag");
mesh->setShaders(":/shaders/rgb-normals.vert", ":/shaders/rgb-normals.frag");
mesh->reallocateNormals(mesh->getNormals());
// RGB Normals triangle to show normals are correct with QTK_DRAW_ARRAYS
mesh = addObject(new Qtk::MeshRenderer(
"rgbTriangleArraysTest", Triangle(QTK_DRAW_ARRAYS)));
mesh->getTransform().setTranslation(7.0f, 0.0f, 2.0f);
mesh->setShaders(":/rgb-normals.vert", ":/rgb-normals.frag");
mesh->setShaders(":/shaders/rgb-normals.vert", ":/shaders/rgb-normals.frag");
mesh->reallocateNormals(mesh->getNormals());
// RGB Normals triangle to show normals are correct with QTK_DRAW_ELEMENTS
mesh = addObject(new Qtk::MeshRenderer(
"rgbTriangleElementsTest", Triangle(QTK_DRAW_ELEMENTS_NORMALS)));
mesh->getTransform().setTranslation(7.0f, 0.0f, 4.0f);
mesh->setShaders(":/rgb-normals.vert", ":/rgb-normals.frag");
mesh->setShaders(":/shaders/rgb-normals.vert", ":/shaders/rgb-normals.frag");
mesh->reallocateNormals(mesh->getNormals());
// Test drawing triangle with glDrawArrays with texture coordinates
mesh = addObject(
new Qtk::MeshRenderer("testTriangleArraysUV", Triangle(QTK_DRAW_ARRAYS)));
mesh->getTransform().setTranslation(-3.0f, 2.0f, -2.0f);
mesh->setShaders(":/texture2d.vert", ":/texture2d.frag");
mesh->setShaders(":/shaders/texture2d.vert", ":/shaders/texture2d.frag");
mesh->setTexture(":/crate.png");
mesh->setTexture(":/textures/crate.png");
mesh->setUniform("uTexture", 0);
mesh->reallocateTexCoords(mesh->getTexCoords());
@ -379,8 +385,8 @@ void ExampleScene::init() {
mesh = addObject(new Qtk::MeshRenderer(
"testTriangleElementsUV", Triangle(QTK_DRAW_ELEMENTS_NORMALS)));
mesh->getTransform().setTranslation(-2.5f, 0.0f, -1.0f);
mesh->setShaders(":/texture2d.vert", ":/texture2d.frag");
mesh->setTexture(":/crate.png");
mesh->setShaders(":/shaders/texture2d.vert", ":/shaders/texture2d.frag");
mesh->setTexture(":/textures/crate.png");
mesh->setUniform("uTexture", 0);
mesh->reallocateTexCoords(mesh->getTexCoords());
}

View File

@ -178,14 +178,18 @@
<addaction name="actionDelete_Object"/>
</widget>
<action name="actionOpen">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<normaloff>:/icons/fontawesome-free-6.2.1-desktop/svgs/regular/folder-open.svg</normaloff>:/icons/fontawesome-free-6.2.1-desktop/svgs/regular/folder-open.svg</iconset>
</property>
<property name="text">
<string>Open...</string>
</property>
</action>
<action name="actionSave">
<property name="icon">
<iconset>
<normaloff>:/icons/resources/fontawesome-free-6.2.1-desktop/svgs/regular/floppy-disk.svg</normaloff>:/icons/resources/fontawesome-free-6.2.1-desktop/svgs/regular/floppy-disk.svg</iconset>
<iconset resource="../../resources/resources.qrc">
<normaloff>:/icons/fontawesome-free-6.2.1-desktop/svgs/regular/floppy-disk.svg</normaloff>:/icons/fontawesome-free-6.2.1-desktop/svgs/regular/floppy-disk.svg</iconset>
</property>
<property name="text">
<string>Save</string>
@ -211,8 +215,8 @@
</action>
<action name="actionLoad_Model">
<property name="icon">
<iconset>
<normaloff>:/icons/resources/fontawesome-free-6.2.1-desktop/svgs/solid/cube.svg</normaloff>:/icons/resources/fontawesome-free-6.2.1-desktop/svgs/solid/cube.svg</iconset>
<iconset resource="../../resources/resources.qrc">
<normaloff>:/icons/fontawesome-free-6.2.1-desktop/svgs/solid/cube.svg</normaloff>:/icons/fontawesome-free-6.2.1-desktop/svgs/solid/cube.svg</iconset>
</property>
<property name="text">
<string>Load Model</string>
@ -223,8 +227,8 @@
</action>
<action name="actionDelete_Object">
<property name="icon">
<iconset>
<normaloff>:/icons/resources/fontawesome-free-6.2.1-desktop/svgs/regular/trash-can.svg</normaloff>:/icons/resources/fontawesome-free-6.2.1-desktop/svgs/regular/trash-can.svg</iconset>
<iconset resource="../../resources/resources.qrc">
<normaloff>:/icons/fontawesome-free-6.2.1-desktop/svgs/regular/trash-can.svg</normaloff>:/icons/fontawesome-free-6.2.1-desktop/svgs/regular/trash-can.svg</iconset>
</property>
<property name="text">
<string>Delete Object</string>
@ -314,7 +318,9 @@
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="../../resources/resources.qrc"/>
</resources>
<connections>
<connection>
<sender>actionExit</sender>

View File

@ -5,12 +5,6 @@
## All Content (c) 2023 Shaun Reed, all rights reserved ##
################################################################################
# TODO: Provide option for linking MainWindow with plugin statically
# TODO: QtkWidget plugin should instantiate a ptr to DebugConsole and store it as a member.
# Then we can connect a signal from MainWindow for creating a console to QtkWidget
# When triggered QtkWidget slot will send signal to MainWindow
# MainWindow catches signal and runs slot to attach DebugConsole to MainWindow as QDockWidget
# TODO: Create a second repository for working on QtkApplication (MainWindow)
################################################################################
# Qtk Library
################################################################################

View File

@ -30,8 +30,8 @@ MeshRenderer::MeshRenderer(const char * name) :
MeshRenderer(name, Cube(QTK_DRAW_ELEMENTS)) {}
MeshRenderer::MeshRenderer(const char * name, const ShapeBase & shape) :
Object(name, shape, QTK_MESH), mVertexShader(":/multi-color.vert"),
mFragmentShader(":/multi-color.frag"), mDrawType(GL_TRIANGLES) {
Object(name, shape, QTK_MESH), mVertexShader(":/shaders/multi-color.vert"),
mFragmentShader(":/shaders/multi-color.frag"), mDrawType(GL_TRIANGLES) {
mShape = Shape(shape);
init();
sInstances.insert(name, this);

View File

@ -50,8 +50,8 @@ namespace Qtk {
*/
inline Model(
const char * name, const char * path,
const char * vertexShader = ":/model-basic.vert",
const char * fragmentShader = ":/model-basic.frag") :
const char * vertexShader = ":/shaders/model-basic.vert",
const char * fragmentShader = ":/shaders/model-basic.frag") :
Object(name, QTK_MODEL),
mModelPath(path), mVertexShader(vertexShader),
mFragmentShader(fragmentShader) {

View File

@ -46,7 +46,7 @@ namespace Qtk {
* @return Default icon to use for Qtk desktop application.
*/
static QIcon getIcon() {
return QIcon(":/icons/resources/icon.png");
return QIcon(":/icons/icon.png");
}
} // namespace Qtk

View File

@ -18,8 +18,9 @@ using namespace Qtk;
Skybox::Skybox(const std::string & name) :
Skybox(
":/right.png", ":/top.png", ":/front.png", ":/left.png", ":/bottom.png",
":/back.png", name) {}
":/textures/skybox/right.png", ":/textures/skybox/top.png",
":/textures/skybox/front.png", ":/textures/skybox/left.png",
":/textures/skybox/bottom.png", ":/textures/skybox/back.png", name) {}
Skybox::Skybox(QOpenGLTexture * cubeMap, const std::string & name) {
mTexture.setTexture(cubeMap);
@ -77,8 +78,10 @@ void Skybox::init() {
// Set up shader program
mProgram.create();
mProgram.addShaderFromSourceFile(QOpenGLShader::Vertex, ":/skybox.vert");
mProgram.addShaderFromSourceFile(QOpenGLShader::Fragment, ":/skybox.frag");
mProgram.addShaderFromSourceFile(
QOpenGLShader::Vertex, ":/shaders/skybox.vert");
mProgram.addShaderFromSourceFile(
QOpenGLShader::Fragment, ":/shaders/skybox.frag");
mProgram.link();
mProgram.bind();