Giter VIP home page Giter VIP logo

dw-sample-framework's Introduction

dwSampleFramework

License: MIT

What is it?

A simple C++ framework for implementing graphics technique samples using OpenGL or Vulkan.

Features

  • Cross-platform
  • Wrapper classes for common OpenGL and Vulkan objects
  • Mesh loading
  • Texture loading
  • Keyboard and mouse input
  • Debug drawing
  • Demo player
  • ImGui integration
  • Camera class
  • CPU-GPU profiler
  • Logger
  • Optional helper classes
    • Vulkan Ray Tracing
    • Hosek-Wilkie sky model
    • Cubemap prefiltering
    • Cubemap SH projection
    • BRDF LUT generation

What it looks like

Creating a project using dwSampleFramework is as easy as inheriting from the dw::Application class and overriding the methods you need.

#include <application.h>

class Tutorial : public dw::Application
{
protected:
	bool init(int argc, const char* argv[]) override
	{
		return true;
	}

	void update(double delta) override
	{

	}

	void shutdown() override
	{

	}
};

DW_DECLARE_MAIN(Tutorial)

Sample

The sample application will give you a basic understanding of how to create a simple graphics application using the framework. It simply renders a rotating Teapot.

Sample

Building Sample

Use CMake version 3.8 or higher to generate a project for any IDE of your choice. The resulting project will contain all dependencies, framework library and sample application. The teapot model and texture can be found inside data/sample_assets.zip. Simply extract it into the directory containing the executable.

How to use in a project

This will only cover using dwSampleFramework in a project that uses CMake since it is more practical and will make handling dependencies easier.

  1. Add dwSampleFramework as a submodule or simply clone it into your external dependencies directory. Make sure all submodules of the framework are also cloned.
  2. Add the dwSampleFramework directory to the root CMakeLists.txt file via the following command.
add_subdirectory(path/to/dwSampleFramework)
  1. Add a link command to your executable that will use the framework.
target_link_libraries(TARGET_NAME dwSampleFramework)
  1. Add dwSampleFramework include directory to your projects' includes (either using include_directories or target_include_directories).

Note: If you wish to use dwSampleFramework as a precompiled library, make sure you copy the generated Assimp config.h file to your Assimp include directory.

Dependencies

License

Copyright (c) 2019 Dihara Wijetunga

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.

dw-sample-framework's People

Contributors

diharaw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.