Skip to content

Commit

Permalink
Add preview for the dynamic blending sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof-Dmitruk-Mobica committed Jul 10, 2023
1 parent 947ca99 commit 9e29c42
Show file tree
Hide file tree
Showing 7 changed files with 731 additions and 0 deletions.
12 changes: 12 additions & 0 deletions framework/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1245,4 +1245,16 @@ void Drawer::text(const char *formatstr, ...)
va_end(args);
}

bool Drawer::color_picker(const char *caption, float *color, ImGuiColorEditFlags flags, uint16_t width)
{
bool res = ImGui::ColorEdit4(caption, color, flags);
if (res)
{
dirty = true;
};
return res;
}



} // namespace vkb
2 changes: 2 additions & 0 deletions framework/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ class Drawer
*/
void text(const char *formatstr, ...);

bool color_picker(const char *caption, float *color, ImGuiColorEditFlags flags, uint16_t width = 0);

private:
bool dirty{false};
};
Expand Down
31 changes: 31 additions & 0 deletions samples/extensions/dynamic_blending/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) 2019, Arm Limited and Contributors
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 the "License";
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

get_filename_component(FOLDER_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
get_filename_component(PARENT_DIR ${CMAKE_CURRENT_LIST_DIR} PATH)
get_filename_component(CATEGORY_NAME ${PARENT_DIR} NAME)

add_sample(
ID ${FOLDER_NAME}
CATEGORY ${CATEGORY_NAME}
AUTHOR "Khronos"
NAME "dynamic_blending"
DESCRIPTION "Sample description"
SHADER_FILES_GLSL
"dynamic_blending/blending.vert"
"dynamic_blending/blending.frag"
)
Loading

0 comments on commit 9e29c42

Please sign in to comment.