Commit Graph

31 Commits

Author SHA1 Message Date
David G Yu
98351a9dc1 Updated C++ standard to C++14
The OpenSubdiv public interface currently requires only C++11 but we
choose this version since C++14 has been the default since GCC 6,
Clang 6, and Visual Studio 2017 (for the most part) and C++14 has been
the default for OpenSubdiv on macOS when support for Metal is enabled.

This setting is guarded so that it can be overridden by the caller when
running CMake.

Fixes #1276
2023-06-30 15:42:23 -07:00
Daniel
4f5834de30 fix opengl loader include error when build with opengl and examples 2022-09-04 01:04:48 +08:00
David G Yu
28f2574bc5 Moved GLEW dependencies to glLoader wrapper
This introduces an internal glLoader library which allows
most of the implementation to be agnostic about the
implementation of the GL loading library.  Specifically,
this removes references to the GLEW headers and libraries
from the rest of the source code and build system.
2020-03-03 17:10:30 -08:00
David G Yu
e0c14ddbef Fixed examples link dependency on GLFW
Split the examples/common objects into graphics API dependent object
libraries (following the pattern used for cemmon Ptex dependencies)
so that DX11 and Metal examples are no longer forced to link with GLFW.
2020-02-12 14:25:14 -08:00
David G Yu
552ebf1376 Fixed Ptex link dependencies
Removed the link dependency from libosd to
the Ptex library since Ptex is used only by the
examples. Updated examples/common to separate
the common Ptex sources from the other common
sources so that they are used only by the Ptex
examples.
2020-01-15 14:47:18 -08:00
barry
936aff0b8a Moved ArgOptions from examples/common to regression/common:
- updated CMakeLists to account for the moved files
    - updated references to argOptions.h in all examples
    - added method to ArgOptions to populate vector<ShapeDesc>
    - minor changes to ViewerArgUtils to use forward references
2019-12-14 12:06:55 -08:00
George ElKoura
92341f7c1e Prefix OpenSubdiv CMake macros
This fixes issue #1157 by adding "osd" as a prefix to public macros.
2019-08-17 16:44:30 -07:00
barry
b7470bb26f Moved definition of struct ShapeDesc into same header file as Shape:
- added definition to regression/common/shape_utils.h
    - removed examples/common/shapeDesc.h and all references to it
    - removed local definitions of ShapeDesc from examples, regressions, etc.
    - overloaded Shape::parseObj() with ShapeDesc
    - updated examples to use Shape::parseObj(ShapeDesc const&);
    - removed axis argument to Shape::ParseObj() and ObjAnim::Create()
2019-04-23 12:05:14 -07:00
George ElKoura
61f5ceabde Factored viewer args parsing for into common place
Started refactoring how we parse arguments for sample viewer
applications into a common place.  This will make it easier
to keep args consistent between applications.
2019-04-08 17:59:46 -07:00
Michael Harris
30cd2df37c Added Metal support 2017-04-19 16:49:53 -07:00
George ElKoura
923d60ca74 Use cmake's folder feature on platforms that support it.
We now make use of folders where they are supported.  In particular, on Visual Studio, this produces much nicer solutions to navigate.
2016-06-09 17:04:26 -07:00
Christopher Jones
87dc09e769 Fix cmake projects to not require GLFW when NO_OPENGL provided and not build gpu lib if not needed. 2015-07-15 23:55:14 -06:00
Takahito Tejima
85bb0a156e examples cleanup: remove framebuffer class
- the framebuffer class in examples/common is unstable in certain drivers.
removing offscreen rendering for now.
- move screenshot function to GLUtils.
- fix vertex attrib binding bug (not showing control mesh on osx)
2015-05-31 20:52:20 -07:00
Takahito Tejima
7394bf5f51 Examples cleanup: factor out control mesh drawing.
- add GLControlMeshDisplay and D3D11ControlMeshDisplay into
  examples/common
- delete all drawCageEdges/drawCageVertices from viewers and
  use ControlMeshDisplay class
2015-05-31 15:08:37 -07:00
George ElKoura
8dc8bcdace Fix build breakage due to recent examples/common refactor.
- Make sure to declare usage of the include files if GLFW is found
- When GLFW is found and is compiled into examples/common, we need to
  unfortunately link it into dxViewer.  Hopefully we can refactor common
  so that this won't be necessary in the future.
2015-05-30 02:34:29 -07:00
Takahito Tejima
89dcea57c2 Fix CMakeLists: make project-relative include path overridable
All examples, regression tests and tutorials directly looked into
opensubdiv source directory to grab the header files. This is somewhat
convenient during development but they can mistakenly access private
header files.

With this change, when OPENSUBDIV_INCLUDE_DIR is given to cmake,
it will be used as an include search path to build examples etc.
Otherwise it follows the same behavior as before.

Also replaces include references to the files in regression dir
to be relative, and cleanups some copy-paste patterns.
2015-05-28 17:32:33 -07:00
Takahito Tejima
c3aa00e706 remove SupportsAdaptiveTessellation from OsdDrawContext, and example cleanups
As a preparation for retiring DrawContext, move SupportsAdaptiveTessellation
method to examples/common/glUtils, which is renamed and namespaced
from gl_common.{cpp,h} to be consistent to other files.
Same renamings applied to other example files.
2015-05-19 10:30:16 -07:00
Takahito Tejima
4a4322983f Osd drawing API refactoring.
Remove DrawRegistry from osd layer and put a simple shader caching
utility into examples/common. osd layer only provides patch shader
snippet and let client configure and compile the code. Clients also
maintain the lifetime of shader object, which is preferable for the
actual application integration.

update all examples to use the new scheme.
2015-05-13 17:35:46 -07:00
Takahito Tejima
8fc0e5db93 Move Ptex code from osd to examples.
we're teasing out ptex specific data from core osd entities,
so there's no reason to keep ptex texturing utilities in core osd.
move them into example libs and let clients assemble shader snippets
as needed.

Also removing older ptex texturing code (without mipmap)
2015-05-07 13:56:48 -07:00
Takahito Tejima
b3da5d3fab remove libpng and use stb_image_write instead 2015-04-30 11:04:16 -07:00
Takahito Tejima
82a0513326 cleanup CL/CUDA example harnesses.
refactor CL/CUDA specific initialization stuffs into
examples/common/clDeviceContext and cudaDeviceContext, and
update examples to use those structs.

also
- remove CL/CUDA tests from osd_regression. The tests for those kernels will be covered by glImaging.
- update cuda initialization to use the GL-interoperable device if available.
- remove CL specialization from glShareTopology, following the same pattern as we took in the previous OsdGLMesh refactoring. (still something strange with XFB kernels though)
- fix file permissions.
2015-04-28 15:46:37 -07:00
manuelk
c399655dcc Landing 3.0.0.alpha
Sync'ing the 'dev' branch with the 'feature_3.0dev' branch at commit 68c6d11fc36761ae1a5e6cdc3457be16f2e9704a

The branch 'feature_3.0dev' is now locked and preserved for historical purposes.
2014-09-05 15:07:46 -07:00
manuelk
84fcf01a40 Fixing broken build (forgot to remove WIP hbao from CMakeList) 2014-05-28 10:37:56 -07:00
Manuel Kraemer
8741687d20 Code cleanup for GLFrameBuffer in examples/common
- cleanup some duplicated code
- change the background color ramp function to make UI more readable
2014-05-27 07:20:57 -07:00
manuelk
9913e349df Adding a programmable image shader to gl_hud
- add a framebuffer to gl_hud with programmable image shader
- add optional SSAO image shader to the new framebuffer
- add screenshot to png functionality
- implement in glViewer

note: ptexViewer and some others still need refactoring to use the new hud capabilities
2014-05-15 13:53:43 -07:00
David G. Yu
d426d6f07c One more fix for the windows cmake build
fixes #258
2014-04-09 15:16:13 -07:00
mkraemer
0f687c4c62 Fix Windows build following CMake changes
Add conditionals testing for non-empty OPENGL_INCLUDE_DIR path

fixes #258
2014-04-09 18:09:53 -04:00
mkraemer
05a7db5e14 Make CMake path variables more robust
Add quotes around variables containing paths - this might require a second pass...

fixes #258
2014-04-09 16:43:38 -04:00
David G Yu
dfb5c100de Added OpenCL header include paths where necessary
This follows existing patterns (more or less), but
there are certainly opportunities to move more of this
sort of logic into macros defined at the top level.
2014-02-22 21:37:11 +00:00
manuelk
1d4891fe8f Fix include paths for new common example objects build (windows build) 2014-01-03 15:29:43 -08:00
manuelk
94d2408c15 File missing from commit: 00b0d95058 2014-01-03 14:22:48 -08:00