forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MATX-236 - Code documentation and some cleanup. (#595)
* Moved VP2 smart pointers to MayaUtil for better discoverability. * WIP MayaUtil documentation. * WIP on doxygen comments. * Doxygen comments for the remaining headers plus minor fixes. * Minor doxygen fixes. * "One or more"
- Loading branch information
Showing
15 changed files
with
248 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,49 @@ | ||
#ifndef MATERIALX_MAYA_MAYAUTIL_H | ||
#define MATERIALX_MAYA_MAYAUTIL_H | ||
|
||
/// @file | ||
/// Maya Viewport 2.0 utilities. | ||
|
||
#include <maya/MTextureManager.h> | ||
#include <maya/MStateManager.h> | ||
|
||
#include <string> | ||
#include <memory> | ||
|
||
namespace MaterialXMaya | ||
{ | ||
namespace MayaUtil | ||
{ | ||
|
||
/// Registers an OGS shade fragment in VP2. Throws an exception if a fragment | ||
/// with the same name is already registered. | ||
/// @param The unique name of the fragment to use for registration. | ||
/// @param The code of the fragment stored in a string. | ||
void registerFragment(const std::string& fragmentName, const std::string& fragmentSource); | ||
} | ||
} | ||
|
||
struct TextureDeleter | ||
{ | ||
/// Releases the reference to the VP2 texture owned by a smart pointer. | ||
void operator()(MHWRender::MTexture* texture); | ||
}; | ||
|
||
using TextureUniquePtr = std::unique_ptr< | ||
MHWRender::MTexture, | ||
TextureDeleter | ||
>; | ||
|
||
struct SamplerDeleter | ||
{ | ||
/// Releases the reference to the VP2 sampler owned by a smart pointer. | ||
void operator()(const MHWRender::MSamplerState* sampler); | ||
}; | ||
|
||
using SamplerUniquePtr = std::unique_ptr< | ||
const MHWRender::MSamplerState, | ||
SamplerDeleter | ||
>; | ||
|
||
} // namespace MayaUtil | ||
} // namespace MaterialXMaya | ||
|
||
#endif |
Oops, something went wrong.