Saturday, June 19, 2021

Win32 application misc.

Win32 application misc. some OpenGL utility tools.

  1. OpenGL Version Check Windows Visual Studio No Dependencies
  2. This fully copy pasteable program shows the version of OpenGL your Windows OS supports..

    when test this demo, we need to set subsystem to Windows(/Subsystems:Windows)

  3. OpenGL Version Check Windows Visual Studio No Dependencies
  4. This fully copy pasteable program shows the version of OpenGL your Windows OS supports..

  5. Win32 Window Minimal
  6. Getting started with Win32 programming through creating a window with minimum code and complexity.

  7. The Simplest Windows Program
  8. Before you can even begin thinking about programming in Windows, you have to be able to understand how this simple program works. Remember to compile this and other Windows programs with the STRICT compilation flag defined!.

  9. A Simple Window
  10. Sometimes people come on IRC and ask "How do I make a window?"...Well it's not entirely that simple I'm afraid. It's not difficult once you know what you're doing but there are quite a few things you need to do to get a window to show up; And they're more than can be simply explained over a chat room, or a quick note..

  11. Class Styles in WNDCLASS, what does it reference to ? Win32
  12. what does it class style means actually ? it confused me. this is from MSDN: style Specifies the class style(s). This member can be any combination of the class styles.

  13. WNDCLASSA structure (winuser.h)
  14. Contains the window class attributes that are registered by the RegisterClass function.

    This structure has been superseded by the WNDCLASSEX structure used with the RegisterClassEx function. You can still use WNDCLASS and RegisterClass if you do not need to set the small icon associated with the window class..

  15. How to encapsulate a WinAPI application into a C++ class
  16. How to encapsulate a WinAPI application into a C++ class.

  17. About Window Class
  18. Each window class has an associated window procedure shared by all windows of the same class. The window procedure processes messages for all windows of that class and therefore controls their behavior and appearance. For more information, see Window Procedures.

    A process must register a window class before it can create a window of that class. Registering a window class associates a window procedure, class styles, and other class attributes with a class name. When a process specifies a class name in the CreateWindow or CreateWindowEx function, the system creates a window with the window procedure, styles, and other attributes associated with that class.

  19. This is a paragraph.

  20. This is a paragraph.

  21. This is a paragraph.

  22. This is a paragraph.

  23. This is a paragraph.

  24. This is a paragraph.

  25. This is a paragraph.

  26. This is a paragraph.

  27. This is a paragraph.

Saturday, June 12, 2021

static keyword in C++

static in C++

    C memory layout

  1. Memory Layout of C Programs
  2. A typical memory representation of a C program consists of the following sections.

    1. Text segment
    2. Initialized data segment
    3. Uninitialized data segment
    4. Stack
    5. Heap

    Basics

  3. Static Variables in C
  4. Static variables have a property of preserving their value even after they are out of their scope! Hence, static variables preserve their previous value in their previous scope and are not initialized again in the new scope.

  5. Static Keyword in C++
  6. Static keyword has different meanings when used with different types. We can use static keyword with:

    1. Static Variables : Variables in a function, Variables in a class
    2. Static Members of Class : Class objects and Functions in a class

  7. static_cast in C++ | Type Casting operators
  8. A Cast operator is an unary operator which forces one data type to be converted into another data type..

  9. What are the default values of static variables in C?
  10. In C, if an object that has static storage duration is not initialized explicitly, then:

    • — if it has pointer type, it is initialized to a NULL pointer;
    • — if it has arithmetic type, it is initialized to (positive or unsigned) zero;
    • — if it is an aggregate, every member is initialized (recursively) according to these rules;
    • — if it is a union, the first named member is initialized (recursively) according to these rules.

  11. Internal static variable vs. External static variable with Examples in C
  12. The static variable may be internal or external depending on the place of declaration. Static variables are stored in initialised data segments..

  13. Initialization of global and static variables in C
  14. Both of the above programs don’t compile in C. We get the following compiler error in C.

    error: initializer element is not constant

    In C, static and global variables are initialized by the compiler itself. Therefore, they must be initialized with a constant value.

    Note that the above programs compile and run fine in C++, and produce the output as 10..

    In Depth

  15. static members
  16. Inside a class definition, the keyword static declares members that are not bound to class instances. Outside a class definition, it has a different meaning: see storage duration ..

  17. Storage class specifiers in C++
  18. The storage class specifiers are a part of the decl-specifier-seq of a name's declaration syntax. Together with the scope of the name, they control two independent properties of the name: its storage duration and its linkage..

  19. Storage-class specifiers in C
  20. Specify storage duration and linkage of objects and functions:

    • auto - automatic duration and no linkage
    • register - automatic duration and no linkage; address of this variable cannot be taken
    • static - static duration and internal linkage (unless at block scope)
    • extern - static duration and external linkage (unless already declared internal)

  21. Type vs. Incomplete type
  22. Type:Objects, references, functions including function template specializations, and expressions have a property called type, which both restricts the operations that are permitted for those entities and provides semantic meaning to the otherwise generic sequences of bits..

    Incomplete type The following types are incomplete types:

    • the type void (possibly cv-qualified);
    • incompletely-defined object types:
      • class type that has been declared (e.g. by forward declaration) but not defined;
      • array of unknown bound;
      • array of elements of incomplete type;
      • enumeration type from the point of declaration until its underlying type is determined.
    All other types are complete.

  23. How to Start the Homework or a Developer Career?
  24. Some tips on what to consider when you start learning to code.

Tuesday, June 8, 2021

CMake tutorials

CMake tutorials & Git quick notes:

    CMake basic command:

  1. Hello CMake!
  2. CMake is one of the most popular build systems for C++ out there. One of the main reasons probably is that it is cross-platform: It does not build the project itself but operates a platform-specific system. That means it can generate Makefiles, ninja-build files, or project files for Visual Studio or Xcode, to name just a few..

  3. CMake series
  4. greate CMake series by a german guy.

  5. It's Time To Do CMake Right
  6. Many of the concepts presented here find their roots in Daniel Pfeifer’s masterpiece Effective CMake. Daniel has practically become the Messiah of the modern CMake church, preaching best practices and guidelines in a time when the only standard is to not have one. Daniel, I am your prophet.

    very good video from Daniel

  7. Use CMake Converter
  8. Quick Use To use cmake converter, simply give your *.sln file to cmake-converter command:.

  9. Learning CMake 1: a really quick introduction to CMake
  10. good series

    We could say that CMake is a framework to build/test/package software. It is not a build system: it is a build system generator. With CMake, we will write how to build our software in a high-level programming language and we will generate a native build system (like Unix Makefiles or Visual Studio Solutions). It's open source and extensively used by different companies and projects.

  11. Generating 64-bit projects for Visual Studio with CMake
  12. Generator Hm, interesting… I thought for some reason that by invoking CMake from the 64-bit Visual Studio command prompt, the project would automatically be generated as a 64-bit target — turns out that this is not the case: Checking the Solution File, the configuration is still set to Win32 (instead of x64) and in the project properties under Linker → Advanced, the Target Machine is still set to /MACHINE:X86 (instead of X64)..

  13. VST3 Project Generator doesn’t see CMake
  14. VST3 Project Generator doesn’t see CMake.

  15. Installing root on windows 10,64bit for visual studio 2019
  16. I started a physics course at university and they required to use root libraries for compiling programs. Is there a way to use root libraries with Visual Studio 2019? i tried to install the last release from the site,the 6.22.06, but when i try to include a library in vs it doesnt work,it show an error; a friend told me it is because root for windows is only for 32bit computers,and mine is 64. To install root i downloaded the .zip file from the site and then placed it to C:\ ,and then from the vs prompt i run c:\root\bin\thisroot.bat as the installation tutorial says in the release page,but then when i try to include libraries it doesnt work as i said before. Can anybody tell me what i am doing wrong?you would save my life,thanks :slight_smile:

  17. Visual studio solution build of CMake
  18. Visual studio solution build of CMake

  19. CMake tutorial & FAQ
  20. CMake tutorial & FAQ.

  21. Visual Studio 16 2019¶
  22. Generates Visual Studio 16 (VS 2019) project files..

    Platform Selection The default target platform name (architecture) is that of the host and is provided in the CMAKE_VS_PLATFORM_NAME_DEFAULT variable.

    The CMAKE_GENERATOR_PLATFORM variable may be set, perhaps via the cmake(1) -A option, to specify a target platform name (architecture). For example:

    1. cmake -G "Visual Studio 16 2019" -A Win32
    2. cmake -G "Visual Studio 16 2019" -A x64
    3. cmake -G "Visual Studio 16 2019" -A ARM
    4. cmake -G "Visual Studio 16 2019" -A ARM64

  23. Why Using CMake
  24. CMake is a tool that allows us to generate project files from our code for a multitude of different environments. By using it we are not tied anymore to a specific IDE environment, like Visual Studio (or a specific version of it), or NetBeans, or CLion, because the project files are going to be independently generated using CMake. We can dictate the project structure in a platform-agnostic manner, so whoever downloads our code can generate the solution project files as we initially planned, regardless of the chosen environment..

  25. CGold: The Hitchhiker’s Guide to the CMake
  26. This guide will show you how to use CMake and will help you to write elegant, correct and scalable projects. We’ll start from the simple cases and add more features one by one. This tutorial covers only part of the CMake capabilities - some topics are skipped intentionally in favor of better modern approaches [1]. This document is designed to be a good tutorial for absolute beginners but also touches on some aspects in which advanced developers may be interested. Look at this document as a skeleton/starting point for further CMake learning..

  27. It's Time To Do CMake Right
  28. Many of the concepts presented here find their roots in Daniel Pfeifer’s masterpiece Effective CMake. Daniel has practically become the Messiah of the modern CMake church, preaching best practices and guidelines in a time when the only standard is to not have one. Daniel, I am your prophet..

  29. [MUC++] Daniel Pfeifer - "Effective CMake"
  30. While CMake has become the de-facto standard buildsystem for C++, it's siblings CTest and CPack are less well known. This talk gives a lightspeed introduction into these three tools and then focuses on best practices on building, testing, and packaging. We will learn how to manage dependencies and export our libraries in such a way that they can be easily used by our clients. We will crosscompile for different platforms and run our tests in an emulator. We will analyze code coverage and perform static and dynamic code analysis. .

  31. CMake @GitLab source code
  32. complete setting for CI.

  33. CMake and Visual Studio
  34. CMake produces Visual Studio solutions seamlessly. This post will map CMake commands to the Visual Studio IDE with an example which makes learning much easier. It is primarily intended for a C++ developer using Visual Studio. Most references here is based on Visual Studio 2010 but will apply equally well to other versions. Continuing from the preface CMake for Visual Studio Developers..

  35. CMake, Visual Studio, and the Command Line
  36. Quick note before we begin: throughout this article, I will be using Visual Studio 2015 on Windows 10 to build the source code of CMake itself. If’s a nice project for a case study, since it’s neither too big nor too small, and has no dependencies to worry about (and of course, it uses CMake to build itself :).

  37. Wrong compiler platform selected with Visual Studio 16 2019 kit
  38. The automatically detected kit for Visual Studio 16 2019 for the x86 platform incorrectly uses the x64 compiler. This can be fixed by adding "platform": "Win32" to the kit configuration in cmake-tools-kits.json and changing "visualStudioArchitecture" from "x86" to "Win32"..

  39. How do I convert a C++ project built with CMake to Visual Studio?
  40. Manually, one file, library or macro definition at a time.

    The best idea is NOT to convert cmake project to visuals studio, as you lose cross-platform support, and if someone setup tests and compiler definition in the project, you lose those as well.

    CMake can generate visual studio project. It’ll still use cmake under the hood, but you’ll work within the idea as usual. So either use cmake -G "Visual Studio 15 2017" or pick desired project type with cmake-gui..

    Git Basics for quick start

  41. 2.1 Git Basics - Getting a Git Repository
  42. If you can read only one chapter to get going with Git, this is it. This chapter covers every basic command you need to do the vast majority of the things you’ll eventually spend your time doing with Git. By the end of the chapter, you should be able to configure and initialize a repository, begin and stop tracking files, and stage and commit changes. We’ll also show you how to set up Git to ignore certain files and file patterns, how to undo mistakes quickly and easily, how to browse the history of your project and view changes between commits, and how to push and pull from remote repositories.

  43. Git official documentations
  44. Git official documentations: index

  45. Git tutorials: External Links
  46. very good collections of Git for quick start.

    Visual Studio 2017 & 2019 Visualization tools

  47. Compiler options listed alphabetically
  48. This table contains an alphabetical list of compiler options. For a list of compiler options by category, see the Compiler options listed by category article..

  49. /FR, /Fr (Create .Sbr File)
  50. Creates .sbr files.

  51. Compiler Options
  52. This is a paragraphcl.exe is a tool that controls the Microsoft C++ (MSVC) C and C++ compilers and linker. cl.exe can be run only on operating systems that support Microsoft Visual Studio for Windows. .

    to generate CodeMap in Visual Studio 2019, you must set browse information compilation option( /FR) in your C++ project. it won't impact binary output.

       

  53. Code Graph
  54. Code Graph is a code visualization tool for Visual Studio 2012-2017 and allows one to explore the code conveniently.

  55. Code Graph for Visual Studio 2019
  56. Code Graph for Visual Studio 2019..

  57. Solution Dependency Viewer
  58. Every wanted to see the web of project reference from your solution. Solution Dependency Viewer provides a graph layer to the solution with projects represented as nodes and project references represented as links between nodes. Current version supports C++, C#, VB projects.

    The graph uses the DGML and the graph model engine in Visual Studio and uses MSBuild Framework to parse solution.

  59. Map dependencies with code maps
  60. In this article, you'll learn how to visualize dependencies across your code with code maps..

    CMake Visualization

  61. CMakeGraphVizOptions¶
  62. The builtin Graphviz support of CMake..

  63. Graphviz GUI tool
  64. GRaphviz GUI tools.

  65. Qt Visual Graph Editor
  66. Qt Visual Graph Editor.

  67. Graphviz
  68. What is Graphviz? Graphviz is open source graph visualization software. Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. It has important applications in networking, bioinformatics, software engineering, database and web design, machine learning, and in visual interfaces for other technical domains..

  69. Graphvize Documentation & User’s Guides
  70. Graphvize Documentation & User’s Guides.

    CMake Build process and generator-expression

  71. CGold: The Hitchhiker’s Guide to the CMake
  72. This guide will show you how to use CMake and will help you to write elegant, correct and scalable projects. We’ll start from the simple cases and add more features one by one. This tutorial covers only part of the CMake capabilities - some topics are skipped intentionally in favor of better modern approaches [1]. This document is designed to be a good tutorial for absolute beginners but also touches on some aspects in which advanced developers may be interested. Look at this document as a skeleton/starting point for further CMake learning..

  73. CMake and object libraries
  74. I recently discovered CMake support for Object Libraries, those are, in simple words, not “real” libraries generating a .lib, .so or .dll files but temporary libraries based in Object files. I find this very useful for supporting different build targets that depends in common code but I don’t need to generate a library at all.

    very useful discovery...

  75. Handling external dependencies in C/C++ with Conan
  76. Conan is another popular cross platform package manager for C/C++, its approach is slightly different. In Conan, the developer has complete control of the package creation and build packages are available (so you don’t have to build the package from scratch just to use it). Maybe the best way to explain the difference is doing the same example as last time but now with Conan..

  77. How to use CMake to configure your projects with deal.II
  78. cmake is controlled by input files that by convention are called CMakeLists.txt, listing both configuration commands as well as dependencies between source files and targets. This page presents some CMakeLists.txt examples for potential use in your projects. (A detailed description of the deal.II project configuration is given in the deal.II CMake ReadMe.)

  79. Details on the deal.II configuration and build system
  80. The deal.II README file gives an overview over the basics of configuring and building the deal.II library. This page provides more details about using the deal.II CMake build system.

  81. Installation instructions and further information on deal.II
  82. Installation instructions and further information on deal.II.

  83. cmake-build system
  84. IntroductionA CMake-based buildsystem is organized as a set of high-level logical targets. Each target corresponds to an executable or library, or is a custom target containing custom commands. Dependencies between the targets are expressed in the buildsystem to determine the build order and the rules for regeneration in response to change..

  85. cmake-generator-expressions(7)
  86. Generator expressions are evaluated during build system generation to produce information specific to each build configuration.

    Generator expressions are allowed in the context of many target properties, such as LINK_LIBRARIES, INCLUDE_DIRECTORIES, COMPILE_DEFINITIONS and others. They may also be used when using commands to populate those properties, such as target_link_libraries(), target_include_directories(), target_compile_definitions() and others.

    This means that they enable conditional linking, conditional definitions used when compiling, and conditional include directories and more. The conditions may be based on the build configuration, target properties, platform information or any other queryable information.

  87. Linking multiple static .lib files into one monolithic .lib file using VS2008 SP1 using CMake 2.8.x
  88. Create a static library "merged" with a dummy source file, and add libs to be merged to the STATIC_LIBRARY_FLAGS, so they will be additional input to lib.exe..

  89. CMake Wildcard for TARGET_OBJECTS
  90. but the $<TARGET_OBJECTS:A > command becomes ugly very quickly. Is there any way to tell CMake to include all .o files in the lib folder for linking everything?

  91. Building a C++ Application on Windows
  92. This section explains how to build an application with the ZED SDK on Windows platforms..

    CMake Tutorials & Examples

  93. Building with CMake
  94. very good series: Building with CMake...

  95. CMake tutorials from CMake.org
  96. Steps The tutorial documentation and source code for examples can be found in the Help/guide/tutorial directory of the CMake source code tree. Each step has its own subdirectory containing code that may be used as a starting point. The tutorial examples are progressive so that each step provides the complete solution for the previous step..

  97. CMake projects in Visual Studio
  98. Microsoft guide.

  99. CMake reference
  100. CMake is a tool to manage building of source code. Originally, CMake was designed as a generator for various dialects of Makefile, today CMake generates modern buildsystems such as Ninja as well as project files for IDEs such as Visual Studio and Xcode..

  101. A CMake Tutorial for Visual C++ Developers
  102. This article provides an introduction to CMake through a series of examples to help you, as VC++ developers, to create and maintain CMake projects.

  103. Working with CMake
  104. This is a developer-oriented introduction to CMake and how to modify the CMake build scripts.

    We assume you already know the basics of how to use cmake to configure and build Inkscape (if not, see Inkscape's README).

  105. what is the proper use of the CMake “project” directive
  106. I've gone through and placed a CMakeLists.txt file at each directory to build each library.

    In each CMakeLists.txt I have used the "project( xxx )" directive. This has defined for me PROJECT_NAME, PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR variables which I make judicious use of.

  107. Tradeof between CMAKE_BINARY_DIR and PROJECT_BINARY_DIR when setting submodule targets' output directories
  108. I'm working on a library which will be used by another project. The main project uses a couple of libraries linked as git submodules. Inside the library project used as a submodule, I can set the LIBRARY_OUTPUT_DIRECTORY and the ARCHIVE_OUTPUT_DIRECTORY in two different ways.

    In option A the targets are built and saved to their own subdirectories using the ${PROJECT_BINARY_DIR}/lib, but in option B all targets are built and saved to the ${CMAKE_BINARY_DIR}/lib directory.

    This could also be extended to binaries built by the submodules. Thus, which of the two options will scale better / is normally used as best-practice?

  109. Cmake PROJECT_BINARY_DIR
  110. Full path to build directory for project.

    This is the binary directory of the most recent project() command.

  111. Using configuration options in c++ using CMake
  112. my note: very useful tips..

    Sometimes when writing generic code you want to only using certain bits of code in special circumstances, for example only use OpenCV code when it is availble. With CMake this is easy.

  113. CMake Tutorial
  114. step by step, various topics in one example

    Modern CMake & Split CMake project into multiple projects

  115. CMake Directory Variables
  116. CMake creates software build systems for a wide variety of platforms based on a single, unified control file–it’s a makefile maker. You create the CMake control file once and based on this file, CMake will create almost any build environment for you: GNU Make for Linux, Eclipse project, Visual Studio solution for Windows, and the list goes on.

    I found the relationship between certain groups of related CMake variables troublesome. I wrote my understanding of these variables to help myself remember, and I will share it with you. If you have an better (or more correct) explanation, please leave a comment..

  117. More Modern CMake
  118. Welcome to HSF CMake tutorial! The aim of this tutorial is to cover the basics of using CMake. This tutorial is based on the online book Modern CMake, with a focus on CMake 3.14+. This is in what is called the “More Modern” era of CMake (roughly defined as 3.12+), and includes the fantastic command line improvements in CMake π (3.14).

    This workshop covers the basics of making and building a project, and some details of design.

  119. An Introduction to Modern CMake
  120. this is the content of its PDF file online.

    People love to hate build systems. Just watch the talks from CppCon17 to see examples of developers making the state of build systems the brunt of jokes. This raises the question: Why? Certainly there are no shortage of problems when building. But I think that, in 2020, we have a very good solution to quite a few of those problems. It's CMake. Not CMake 2.8 though; that was released before C++11 even existed! Nor the horrible examples out there for CMake (even those posted on KitWare's own tutorials list). I'm talking about Modern CMake. CMake 3.4+, maybe even CMake 3.20+! It's clean, powerful, and elegant, so you can spend most of your time coding, not adding lines to an unreadable, unmaintainable Make (Or CMake 2) file. And CMake 3.11+ is supposed to be significantly faster, as well!

    you can download a PDF version of this book. it is saved in C:\DemoCmake folder one copy

  121. Scott Craig's blog:Enabling C++11 And Later In CMake
  122. With the constant evolution of C++, build systems have had to deal with the complication of selecting the relevant compiler and linker flags. If your project targets multiple platforms and compilers, this can be a headache to set up. Happily, with features added in CMake 3.1, it is trivial to handle this in a generic way..

  123. Generated Sources In CMake Builds
  124. Using a set of source files to build libraries and executables is about the most basic thing a build system needs to do. This is relatively easy with CMake, but things get more interesting when some of the source files need to be generated as part of the build. CMake provides a range of functionality which can be used to create files, but getting build dependencies correct is an area where many developers struggle or even simply give up. It doesn’t have to be that way!

    Comments: Very useful indeed. Thanks a lot. I’ve now got something which takes my GLSL shaders and puts them into a map of inside the C++ code, thus solving my “how to embed my shaders in the executable” problem, nicely.

  125. Enhanced source file handling with target_sources()
  126. In all but trivial CMake projects, it is common to find targets built from a large number of source files. These files may be distributed across various subdirectories, which may themselves be nested multiple levels deep. In such projects, traditional approaches usually either list all source files at the top-most level or build up the list of source files in a variable and pass that to add_library(), add_executable(), etc. With CMake 3.1, a new command target_sources() was introduced which provides the missing piece among the various target_... commands. While the CMake documentation succintly describes what target_sources() does, it fails to highlight just how useful the new command is and why it promotes better CMake projects:.

  127. PROJECT_BINARY_DIR
  128. Full path to build directory for project.

    This is the binary directory of the most recent project() command..

  129. CMake 3.20 (English)
  130. CMake documentation & command list.

  131. Basic CMake usage, Part 1
  132. The end of a semester is here and, as I grade our student's semestral works, I get to use Makefiles and CMakeLists of dubious quality[1]. After seeing the same errors repeated over and over again, I decided to write a short tutorial towards writing simple Makefiles and CMakeLists. This is the CMake tutorial, the Make one can be found here..

    the source code can be downloaded from this link: In case you do care, here is a link to one of the zips that contains them. ↩︎

  133. Basic CMake, part 2: libraries
  134. My previous post about CMake provided a simple CMakeLists.txt for a small, self-contained, project. In practice, very few projects are fully self-contained, as they either depend on external libraries or are themselves libraries that other projects depend on. This post shows how to create and consume simple libraries using modern CMake.

  135. splitting a project into a library and a application
  136. I'm using cmake for my project. No I want to split some parts into a library and use this for 2 different applications..

  137. Splitting large C++ project
  138. Like it happens to many, our C++ project grew larger and larger, and it finally hit the point where maintainability starts to be a concern, mostly due to build times: even by using ccache, every change requires anywhere from 30 seconds to 5 minutes to rebuild and test (actually it seems that "linking" is the time-consuming phase, but we are still investigating).

    The project consists mainly of a big scientific library, along with some applications which make use of it. For example, there are applications to augment simulation models, or language bindings (python) for integration into other software packages.

  139. How can I effectively use one file per class in C++?
  140. Even though I have a decent bit of professional experience with object oriented programming in Java and a basic familiarity with C, I've run into a bit of a mental block with C++ that I was hoping other developers could help me shine a light on..

  141. What are forward declarations in C++?
  142. What are forward declarations in C++?

Monday, June 7, 2021

SOIL2 library

SOIL2 library

  1. Simple OpenGL Image Library 2
  2. Introduction: SOIL2 is a fork of the Jonathan Dummer's Simple OpenGL Image Library.

    SOIL2 is a tiny C library used primarily for uploading textures into OpenGL. It is based on stb_image, the public domain code from Sean Barrett.

    SOIL2 extended stb_image to DDS files, and to perform common functions needed in loading OpenGL textures.

    SOIL2 can also be used to save and load images in a variety of formats (useful for loading height maps, non-OpenGL applications, etc.)

    it has examples on how to use this lib.

    Origins

  3. Simple OpenGL Image Library
  4. Introduction: SOIL is a tiny C library used primarily for uploading textures into OpenGL. It is based on stb_image version 1.16, the public domain code from Sean Barrett (found here). I have extended it to load TGA and DDS files, and to perform common functions needed in loading OpenGL textures. SOIL can also be used to save and load images in a variety of formats (useful for loading height maps, non-OpenGL applications, etc.)

    Download: You can grab the latest version of SOIL here. (July 7, 2008: see the change log at the bottom of this page.) You can also checkout the latest code from the new SVN repository, login as guest/guest: svn://www.twisted-works.com/jdummer/public/SOIL.

  5. nothings / stb
  6. single-file public domain (or MIT licensed) libraries for C/C++

  7. Modern OpenGL 3.0+ [SETUP] Windows Visual Studio SOIL Setup
  8. This is a paragraph.

  9. Download Premake
  10. Premake is a self-contained, single file command line executable which should build and run pretty much everywhere. See Using Premake for usage instructions and help getting started

  11. Download Premake
  12. Download Premake.

  13. OpenGL/C++ 3D Tutorial 07 - Linking SOIL2 in Visual Studio
  14. OpenGL/C++ 3D Tutorial 07 - Linking SOIL2 in Visual Studio

  15. Learning Modern OpenGL
  16. A little guide about modern OpenGL and why it gives us so much value..

  17. OpenGL Development Cookbook/a>
  18. Review of a very interesting book about Modern OpenGL Application Development..

  19. C++ Standard Library, The: A Tutorial and Reference 2nd Edition
  20. A good book

  21. glGenerateMipmap Plus SOIL library, OpenGL
  22. glGenerateMipmap Plus SOIL library.

  23. Digging into SOIL Library for OpenGL
  24. Digging into SOIL Library for OpenGL

Saturday, June 5, 2021

Drawing Algorithms collections

Drawing Algorithms collections

  1. Mid-Point Circle Drawing Algorithm
  2. The mid-point circle drawing algorithm is an algorithm used to determine the points needed for rasterizing a circle..

  3. Midpoint ellipse drawing algorithm
  4. Mid-point Ellipse algorithm is used to draw an ellipse in computer graphics..

  5. Draw circles using the polar coordinates and mid-point circle drawing algorithm on the same console using openGL in C++
  6. In this article, the task is to draw circles in two different subwindows using two different algorithms, and the circles are created using a single mouse click..

  7. Program to draw circles using mouse moves in OpenGL
  8. n this article, the task is to draw circles using a single mouse click in OpenGL.

  9. This is a paragraph.

  10. This is a paragraph.

  11. This is a paragraph.

  12. This is a paragraph.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

  20. This is a paragraph.

  21. This is a paragraph.

  22. This is a paragraph.

how to know if computer has gpu

how to know if computer has gpu

  1. How to Check What Graphics Card (GPU) Is in Your PC
  2. All computers have graphics hardware that handles everything from drawing your desktop and decoding videos to rendering demanding PC games. Most modern PCs have graphics processing units (GPUs) made by Intel, NVIDIA, or AMD.

  3. How To Check If You Have A Dedicated GPU
  4. A GPU or graphics processing unit is an essential component in every computer. It doesn’t matter if you own a Mac or a PC, both have a GPU. Since there’s a lot of variation in the specs of a PC, it might be hard to tell if you have a dedicated GPU or not. It’s actually pretty easy to tell if you know where and what to look for.

    As stated earlier, all computers have a GPU. However, not all computers have a dedicated GPU. It’s not necessary to have one unless you intend to use your PC for gaming. An integrated GPU is a graphics chipset built into the motherboard. A dedicated GPU is a second GPU that’s installed on the motherboard. If you’re talking about a PC, the integrated GPU will likely be an Intel chip while the dedicated GPU will either be an Nvidia or AMD chip.

  5. How do I know which computer video card I have?
  6. Whether you're looking to upgrade or are curious about your computer's specifications, you may want to know what video card, or GPU, is in the computer. Some PCs have integrated graphics, and some have a video card. In either case, the instructions below help you determine and view the graphics device powering your computer's video output. To proceed, choose your preferred method from the list below, or read all of the sections and proceed from there..

Wednesday, June 2, 2021

Diligent Engine

Diligent Engine

    A Good Book

  1. Practical Shader Development: Vertex and Fragment Shaders for Game Developers 1st ed. Edition
  2. It’s time to stop thinking that shaders are magical. You can use shaders to turn data into stunning visual effects, and get your hands dirty by building your own shader with this step-by-step introduction to shader development for game and graphics developers. Learn how to make shaders that move, tint, light up, and look awesome, all without cracking open a math textbook..

  3. Computer Graphics: Concepts, Algorithms and Implementation using C and OpenGL Paperback – November 4, 2020
  4. The book presents comprehensive coverage of fundamental computer graphics concepts in a simple, lucid, and systematic way. It uses C programming language to implement various algorithms explained in the book. It also introduces the popular OpenGL programming language with illustrative examples of the multiple primitive functions in OpenGL.The book teaches you a wide range of exciting topics such as graphics devices, scan conversion, polygons, segments, 2D and 3D transformations, windowing and clipping, 3D object representation, illumination models and shading algorithms, colour models, visible surface detection algorithms, curves, grammar-based models, turtle graphics, ray tracing, and fractals. The book also explains concepts in animation..

    A good OpenGL tutorial website

  5. opengl-tutorial site
  6. This site is dedicated to tutorials for OpenGL 3.3 and later ! Full source code is available here..

    Diligent Engine

  7. Samples and Tutorials
  8. Tutorials are simple graphics applications intended to demonstrate the usage of the Diligent Engine API. The samples’ source files are hosted in DiligentSamples repository (https://github.com/DiligentGraphics/DiligentSamples). The following tutorials and samples are currently implemented..

  9. DiligentEngine major website
  10. Diligent Engine 2.5: resource signatures, inline ray tracing, async compute and much more This is a major release that introduces a number of significant improvements: Pipeline resource signatures enable applications to define explicit shader resource layouts that allow sharing shader resource binding objects between different pipeline states. Multiple immediate contexts is an abstraction… READ MORE.

  11. Downloading Git:: I choose to use Git command
  12. You are downloading the latest (2.32.0) 64-bit version of Git for Windows. This is the most recent maintained build. It was released 9 days ago, on 2021-06-07..

  13. GitHub Desktop
  14. GitHub DesktopFocus on what matters instead of fighting with Git. Whether you're new to Git or a seasoned user, GitHub Desktop simplifies your development workflow..

  15. Diligent Engine Rendering Framework
  16. Diligent Graphics just released Diligent Engine 2.4b. Diligent Engine is a cross platform open source rendering framework that abstracts away the details of the underlying OpenGL,.

  17. DiligentFX framework
  18. DiligentFX is the Diligent Engine's high-level rendering framework..

  19. Diligent Engine : self equiped tool::HLSL to GLSL Source Converter
  20. DirectX and OpenGL use different shading languages, which share a lot in common, but sometimes differ substantially. For cross-platform applications, maintaining two versions of each shader is time-consuming and error-prone. Diligent Engine uses HLSL2GLSL Converter that allows shader authored in HLSL to be converted into GLSL source. Since no intermediate representation is used, all tools available for HLSL shader development, analysis and optimization can be used directly, while GLSL source is automatically generated from HLSL shaders..

  21. Diligent Engine:: HLSL::Supported Features
  22. Supported HLSL version: 5.0 Supported shader types:

    • Vertex Shader
    • Geometry Shader
    • Hull Shader (Tessellation Control Shader)
    • Domain Shader (Tessellation Evaluation Shader)
    • Pixel Shader (Fragment Shader)
    • Compute Shader.

  23. Diligent Graphics
  24. Pinned repositories.

  25. Diligent Engine: A Modern Cross-Platform Low-Level Graphics Library
  26. This article describes Diligent Engine, a light-weight cross-platform graphics API abstraction layer that is designed to solve these problems. Its main goal is to take advantages of the next-generation APIs such as Direct3D12 and Vulkan, but at the same time provide support for older platforms via Direct3D11, OpenGL and OpenGLES..

  27. Getting Started with Mesh Shaders in Diligent Engine
  28. Introduction to amplification and mesh shaders, the new programmable stages available in modern GPUs, and how to use them to implement view frustum culling and object LOD selection on the GPU using the Diligent Engine API.

  29. Comparing GPU Resource Update Strategies in Diligent Engine
  30. This article describes several strategies to update GPU resources in Diligent Engine (a modern low-level graphic library) as well as important internal details and performance implications related to each method..

  31. Diligent Engine on Facebook
  32. Integration with GLFW was one of the most frequently asked questions, so we added a simple maze mini-game that shows how to use Diligent Engine with GLFW.

  33. Diligent solutions to rendering problems
  34. Diligent solutions to rendering problems.

    Diligent Engine is a lightweight cross-platform graphics API abstraction library. It is designed to take full advantage of Direct3D12, Vulkan and Metal, while supporting older platforms via Direct3D11, OpenGL and OpenGLES. Diligent Engine exposes common front-end API and uses HLSL as universal shading language on all platforms and rendering back-ends. Platform-specific shader representations (GLSL, DX bytecode or SPIRV) can be used with corresponding back-ends. The engine is intended to be used as graphics subsystem in a game engine or any other 3D application. Full source code is available on GitHub. It is distributed under Apache 2.0 license and is free to use.

  35. OpenGL Projection Matrix
  36. OpenGL Projection Matrix.

  37. OpenGL中frustum投影矩阵的推导
  38. OpenGL中,有一个函数叫frustum,字面的意思是截锥体,也就是一个去掉头部的锥体,如下图所示,.

    HLSL vs. GLSL

  39. Mapping between HLSL and GLSL
  40. It’s 2016 and we’re still stuck with various shading languages - the current contenders being HLSL for Direct3D, and GLSL for OpenGL and as the “default” front-end language to generate SPIR-V for Vulkan. SPIR-V may become eventually the IL of choice for everything, but that will take a while, so right now, you need to convert HLSL to GLSL or vice versa if you want to target both APIs..

  41. What are the pros and cons of HLSL vs GLSL vs cg? [closed]
  42. What are the pros / cons of the three?

  43. aras-p / hlsl2glslfork
  44. This is a paragraph.

  45. Thekla/hlslparser
  46. HLSLParser This is a fork of Unknownworld's hlslparser adapted to our needs in The Witness. We currently use it to translate pseudo-HLSL shaders (using the legacy D3D9 syntax) to HLSL10 and Metal Shading Language (MSL). There's also a GLSL translator available that we do not use yet, but that is being maintained by community contributions.

    The HLSL parser has been extended with many HLSL10 features, but retaining the original HLSL C-based syntax.

  47. HLSL2GLSL
  48. Note - this project development has moved to this site: http://code.google.com/p/hlsl2glslfork/ . The project is a good base and its fork (thlsl2glslfork) is used by OGRE and Unity3D for real-time Cg to GLSL conversion..

  49. A Review of Shader Languages
  50. A review of the state of the art in real time graphics shading languages and compilers. What are some of the differences between GLSL, HLSL, and Metal? What are some ways to transpile shaders?.

    Shading languages are similar to each other, with minor differences in keywords, but different underlying designs philosophies such as the union of samplers and textures in GLSL, or the buffer attribute model of Metal. It's not too difficult to work around these differences though, and bridge the gap between HLSL, GLSL, and MSL.

  51. programming GPU- HLSL languages
  52. Randy Fernando Randy Fernando Developer Technology Group.

  53. the book site & info
  54. te book information.

  55. GLSL/HLSL Shading programming
  56. Good site::GLSL/HLSL Shading programming.

GLSL vs. HLSL - Shader class in OpenGL

search "shader" in codeproject.com

    GLSL Basics

  1. Rendering a Triangle using OpenGL(using Shaders)
  2. In this article we’ll see how to render a triangle using OpenGL. A triangle is probably the simplest shapes you can draw in OpenGL after points and lines and any complicated geometry that you make will me made up of number of triangles joined together..

  3. Tutorial 1 : Opening a window
  4. Before jumping into OpenGL, you will first learn how to build the code that goes with each tutorial, how to run it, and most importantly, how to play with the code yourself..

  5. Tutorial 2 : The first triangle
  6. OpenGL 3 makes it easy to write complicated stuff, but at the expense that drawing a simple triangle is actually quite difficult..

  7. Built-in Variable (GLSL)
  8. The OpenGL Shading Language defines a number of special variables for the various shader stages. These built-in variables (or built-in variables) have special properties. They are usually for communicating with certain fixed-functionality. By convention, all predefined variables start with "gl_"; no user-defined variables may start with this..

  9. OpenGL: Defining variables in shaders
  10. My OpenGL program, using GLSL for shaders, has a simple vertex and fragment shader (given by a tutorial)..

  11. Creating a triangle with OpenGL & GLSL
  12. I'm trying to get a triangle on screen. The code works except there is no triangle. I'm using simple pass-through shaders to achieve this goal..

    HLSL Basics

  13. Introduction - HLSL Shader Creation 1 - HLSL Shader Fundamentals
  14. In the first of our Advanced series on HLSL Shader writing within 3dsmax, Ben Cloward will give you an understanding of what an HLSL shader is, how a shader can be created with free software, edited, and then displayed within 3dsmax. Fundamental programming concepts such as Data Types, Structs and Functions will be covered. How to create a shader GUI, the basic framework of an HLSL FX shader and much much more. By the close of the series, Ben will have you writing your own basic HLSL shaders.

    This series is an ideal introduction to the world of HLSL shader writing for real-time GPU based shaders. An understanding of basic programming concepts and 3D math is useful.

  15. GLSL/HLSL Shading programming
  16. GLSL/HLSL Shading programming.

  17. FX Composer
  18. FX Composer is no longer in active development and will not receive any further updates. v2.5 is the final release of this product. Please refer to NVIDIA Nsight Visual Studio Edition for your shader debugging/profiling/authoring needs..

  19. Programming guide for HLSL
  20. Data enters the graphics pipeline as a stream of primitives and is processed by the shader stages. The actual shader stages depend on the version of Direct3D, but certainly include the vertex, pixel and geometry stages. Other stages include the hull and domain shaders for tessellation, and the compute shader. These stages are completely programmable using the High Level Shading Language (HLSL)..

    Compile HLSL files in Visual Studio 2012+

  21. .HLSL file for OpenGL Shaders
  22. I'm trying to make a simple OpenGL application using this tutorial. It says I can give shaders whatever file extention I want. However, in VS2013, when I click "add new item", go to Visual C++ tab and add a Pixel Shader or Vertex Shader, it doesn't compile right and I get errors. Why is this happening? Why can't I use the .hlsl files for my shaders while a regular .txt simply compiles? .

  23. HLSL Property Pages
  24. You can use the HLSL compiler (fxc.exe) property pages to configure how individual HLSL shader files are built. The properties are divided into three categories:.

  25. Compiling shaders
  26. Microsoft Visual Studio 2012 can now compile shader code from *.hlsl files that you include in your C++ project.

  27. Programming guide for HLSL
  28. Data enters the graphics pipeline as a stream of primitives and is processed by the shader stages. The actual shader stages depend on the version of Direct3D, but certainly include the vertex, pixel and geometry stages. Other stages include the hull and domain shaders for tessellation, and the compute shader. These stages are completely programmable using the High Level Shading Language (HLSL).

    HLSL shaders can be compiled at author-time or at runtime, and set at runtime into the appropriate pipeline stage. Direct3D 9 shaders can be designed using shader model 1, shader model 2 and shader model 3; Direct3D 10 shaders can only be designed on shader model 4. Direct3D 11 shaders can be designed on shader model 5. Direct3D 11.3 and Direct3D 12 can be designed on shader model 5.1, and Direct3D 12 can also be designed on shader model 6..

  29. The most powerful shader IDE
  30. free, open-source, cross-platform, feature-rich..

  31. Tools & libraries
  32. Many good shader tools & Libs.

  33. Programming GPU-HLSL language
  34. the evolution of GPU programming language

  35. Selecting a Shading Language
  36. The various extensions and core revisions of the OpenGL API have led to the availability of a number of different potential shading languages that you may use. This page will deal with what they are, their pros and cons, and hardware..

  37. GLSL - best tutorials
  38. GLSL - best tutorials

  39. Swiftless GLSL Shader Developer
  40. Swiftless GLSL Shader Developer.

  41. A Beginner's Guide to Coding Graphics Shaders.
  42. A Beginner's Guide to Coding Graphics Shaders..

  43. GLSL-to-HLSL reference
  44. You port your OpenGL Shader Language (GLSL) code to Microsoft High Level Shader Language (HLSL) code when you port your graphics architecture from OpenGL ES 2.0 to Direct3D 11 to create a game for Universal Windows Platform (UWP). The GLSL that is referred to herein is compatible with OpenGL ES 2.0; the HLSL is compatible with Direct3D 11. For info about the differences between Direct3D 11 and previous versions of Direct3D, see Feature mapping..

    GLslang & HLSL2GLSL legacy tools

  45. GLSL vs HLSL==> difference
  46. a pdf file and very good comparison. can see where HLSL is turned into GLSL...

  47. GLSlang::OpenGL / OpenGL ES Reference Compiler -- from Kronos.org
  48. OpenGL / OpenGL ES Reference Compiler Glslang is the official reference compiler front end for the OpenGL ES and OpenGL shading languages. It implements a strict interpretation of the specifications for these languages. It is open and free for anyone to use, either from a command line or programmatically. The OpenGL and OpenGL ES working groups are committed to maintaining consistency between the reference compiler and the corresponding shading language specifications.

    Purpose The primary purpose of the reference compiler is to identify shader portability issues. If glslang accepts a shader without errors, then all OpenGL and OpenGL ES implementations claiming to support the shader's language version should also accept the shader without errors. Likewise, if glslang reports an error when compiling a shader, all OpenGL and OpenGL ES implementations for that language version should report errors, unless the glslang errors are caused by differences in implementation-defined limits or extension support (see below).

    Secondarily, glslang is also suitable for programmatic use in a tool chain or a driver, translating the input source into an abstract syntax tree that can be translated into an intermediate representation for machine-independent processing and lowering to machine-specific code. Glslang can also return (even from the command line) uniform variable reflection information (before optimization)..

  49. KhronosGroup/glslang
  50. Instead of building manually, you can also download the binaries for your platform directly from the master-tot release on GitHub. Those binaries are automatically uploaded by the buildbots after successful testing and they always reflect the current top of the tree of the master branch..

  51. HLSL2GLSL
  52. HLSL2GLSL is a library and tool that converts HLSL shaders to GLSL.. on sourceforge.com

  53. aras-p / hlsl2glslfork
  54. As of mid-2016, the project is unlikely to have any significant developments. At Unity we are moving to a different shader compilation pipeline. So from my side there won't be significant work done on it. You might want to look into HLSLParser, HLSLcc or glslang instead..

    Diligent Engine tool- HLSL2GLSL converter

  55. Standalone Converter
  56. This is a paragraph.

  57. State-of-the-art HLSL to GLSL Converter
  58. Diligent Engine uses state-of-the art shader sonverter that allows transforming HLSL source into GLSL. The converter supports HLSL 5.0 and all shader types (vertex, pixel, geometry, hull, domain, and compute).

    it has tutorials on how to use this tool..

  59. Converting GLSL to HLSL
  60. Converting GLSL to HLSL.

  61. DiligentGraphics / DiligentTools
  62. It lists many good tools...

  63. HLSL Introduction
  64. High Level Shading Language (HLSL), a programming language for Graphic Processing Unit (GPU) in DirectX 9/10/11, supports the shader construction with C-like syntax, types, expressions, statements, and functions..

class vs. struct in C++

class vs. struct

  1. When should you use a class vs a struct in C++?
  2. In what scenarios is it better to use a struct vs a class in C++?.

  3. Structs vs classes in C++ [duplicate]
  4. When should someone use structs instead of classes or vice versa in C++? I find myself using structs when a full-blown class managing some information seems like overkill but want to indicate the information being contained are all related. I was wondering what are some good guidelines to be able to tell when one is more appropriate than the other?

    Edit: Found these links while reading the material Stack Overflow indicated was related after the question was submitted:

  5. Use of class and struct [duplicate]
  6. This is a paragraph.

  7. When is using a struct more reasonable than using a class in C++? [duplicate]
  8. This is a paragraph.

  9. When is using a struct more reasonable than using a class in C++? [duplicate]
  10. I have been reading Qt Creator's source code. When is using a struct more appropriate than using a class in C++?.

  11. When should you use a class vs a struct in C++?
  12. In what scenarios is it better to use a struct vs a class in C++?.

  13. Where and why do I have to put the “template” and “typename” keywords?
  14. In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?

  15. Structs vs classes in C++ [duplicate]
  16. When should someone use structs instead of classes or vice versa in C++? I find myself using structs when a full-blown class managing some information seems like overkill but want to indicate the information being contained are all related. I was wondering what are some good guidelines to be able to tell when one is more appropriate than the other?

  17. When is using a struct more reasonable than using a class in C++? [duplicate]
  18. I have been reading Qt Creator's source code. When is using a struct more appropriate than using a class in C++?.

  19. This is a paragraph.

  20. This is a paragraph.

  21. This is a paragraph.

  22. This is a paragraph.

  23. This is a paragraph.

  24. This is a paragraph.

  25. This is a paragraph.

  26. This is a paragraph.

  27. This is a paragraph.