本文整理汇总了C++中StrCRef类的典型用法代码示例。如果您正苦于以下问题:C++ StrCRef类的具体用法?C++ StrCRef怎么用?C++ StrCRef使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StrCRef类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateBufferFromFile
/**
* @see CreateBufferHelloWorld
*
* @alsymbols
* @alutfunref{CreateBufferFromFile}
*/
Buffer CreateBufferFromFile(const StrCRef& file_path) const {
assert(_initialized);
ALuint name = OALPLUS_ALUTFUNC(CreateBufferFromFile)(
file_path.is_nts() ? file_path.c_str() : file_path.str().c_str());
OALPLUS_VERIFY_SIMPLE_ALUT(CreateBufferFromFile);
return Buffer::FromRawName(BufferName(name));
}
示例2: Delete
/// Deletes the value stored under @p name
static void Delete(const StrCRef& name)
{
OGLPLUS_GLFUNC(DeleteNamedStringARB)(
GLint(name.size()),
name.c_str()
);
OGLPLUS_CHECK_SIMPLE(DeleteNamedStringARB);
}
示例3: PushGroup
/// Pushes a debug group
static void PushGroup(
DebugSource source,
GLuint id,
StrCRef message
)
{
PushGroup(source, id, message.size(), message.c_str());
}
示例4: ObjectLabel
static void ObjectLabel(const ObjectName<ObjTag>& object, StrCRef label) {
OGLPLUS_GLFUNC(ObjectLabel)
(GetGLName(object),
ObjTypeOps<ObjTag>::ObjectType(),
label.size(),
label.c_str());
OGLPLUS_VERIFY_SIMPLE(ObjectLabel);
}
示例5: IsA
/// Checks if @p name is a stored string
static bool IsA(const StrCRef& name)
{
GLboolean result = OGLPLUS_GLFUNC(IsNamedStringARB)(
GLint(name.size()),
name.c_str()
);
OGLPLUS_CHECK_SIMPLE(IsNamedStringARB);
return result == GL_TRUE;
}
示例6: MakeLayout
Layout MakeLayout(const Font& font, StrCRef str)
{
CodePoints cps;
UTF8ToCodePoints(str.begin(), str.size(), cps);
Layout layout(MakeLayout(font, str.size()));
layout.Set(cps.data(), cps.size());
return std::move(layout);
}
示例7: Type
/// Gets the type of the named string stored under @p name
static NamedStringType Type(const StrCRef& name)
{
GLint result = 0;
OGLPLUS_GLFUNC(GetNamedStringivARB)(
GLint(name.size()),
name.c_str(),
GL_NAMED_STRING_TYPE_ARB,
&result
);
OGLPLUS_CHECK_SIMPLE(GetNamedStringivARB);
return NamedStringType(GLenum(result));
}
示例8: Group
/**
* @overload
*
* @glsymbols
* @glfunref{PushDebugGroup}
*/
Group(
DebugOutputSource source,
GLuint id,
StrCRef message
)
{
OGLPLUS_GLFUNC(PushDebugGroup)(
GLenum(source),
id,
message.size(),
message.begin()
);
OGLPLUS_VERIFY_SIMPLE(PushDebugGroup);
}
示例9: InsertMessage
/// Inserts a new message into the debug output
static void InsertMessage(
DebugOutputARBSource source,
DebugOutputARBType type,
GLuint id,
DebugOutputARBSeverity severity,
StrCRef message) {
OGLPLUS_GLFUNC(DebugMessageInsertARB)
(GLenum(source),
GLenum(type),
id,
GLenum(severity),
GLsizei(message.size()),
message.c_str());
OGLPLUS_VERIFY_SIMPLE(DebugMessageInsertARB);
}
示例10: Set
/// Store the @p value, of the specified @p type under @p name
static void Set(
NamedStringType type,
const StrCRef& name,
const StrCRef& value
)
{
OGLPLUS_GLFUNC(NamedStringARB)(
GLenum(type),
GLint(name.size()),
name.c_str(),
GLint(value.size()),
value.c_str()
);
OGLPLUS_CHECK_SIMPLE(NamedStringARB);
}
示例11: GetLocation
/** Finds the location / index of the fragment data specified
* by @p identifier in a @p program. If active_only is true then
* throws if no such fragment data output exists or if it is not active.
*
* @glsymbols
* @glfunref{GetFragDataLocation}
*/
static GLint GetLocation(
ProgramName program,
StrCRef identifier,
bool active_only
)
{
GLint result = OGLPLUS_GLFUNC(GetFragDataLocation)(
GetGLName(program),
identifier.c_str()
);
OGLPLUS_CHECK(
GetFragDataLocation,
ProgVarError,
Program(program).
Identifier(identifier)
);
OGLPLUS_HANDLE_ERROR_IF(
active_only && (result < 0),
GL_INVALID_OPERATION,
MsgGettingInactive(),
ProgVarError,
Program(program).
Identifier(identifier)
);
return result;
}
示例12: InsertMessage
/// Inserts a new message into the debug output
static void InsertMessage(
DebugSource source,
DebugType type,
GLuint id,
DebugSeverity severity,
StrCRef message
)
{
InsertMessage(
source,
type,
id,
severity,
message.size(),
message.c_str()
);
}
示例13: BindLocation
/**
* @see GetLocation
* @see QueryLocation
*
* @glsymbols
* @glfunref{BindFragDataLocation}
*/
static void BindLocation(
ProgramName program, FragDataSlot location, StrCRef identifier) {
OGLPLUS_GLFUNC(BindFragDataLocation)
(GetGLName(program), GLuint(location), identifier.c_str());
OGLPLUS_CHECK(
BindFragDataLocation,
ProgVarError,
Program(program).Identifier(identifier).Index(GLuint(location)));
}
示例14: LoadMemoryFromFile
/**
* @see LoadMemoryFromFileNormalized
* @see LoadMemoryHelloWorldNormalized
*
* @alsymbols
* @alutfunref{LoadMemoryFromFile}
*/
std::vector<ALubyte> LoadMemoryFromFile(
const StrCRef& file_path,
DataFormat* data_format,
ALfloat* frequency) const {
::ALenum format = 0;
::ALsizei size = 0;
::ALvoid* ptr = OALPLUS_ALUTFUNC(LoadMemoryFromFile)(
file_path.is_nts() ? file_path.c_str() : file_path.str().c_str(),
&format,
&size,
frequency);
OALPLUS_CHECK_SIMPLE_ALUT(LoadMemoryFromFile);
_free_on_scope_exit cleaner = {ptr};
OALPLUS_FAKE_USE(cleaner);
if(data_format)
*data_format = DataFormat(format);
return _load_memory(ptr, size);
}
示例15: Get
/// Gets the value stored under @p name
static String Get(const StrCRef& name)
{
GLint len = 0;
OGLPLUS_GLFUNC(GetNamedStringivARB)(
GLint(name.size()),
name.c_str(),
GL_NAMED_STRING_LENGTH_ARB,
&len
);
OGLPLUS_CHECK_SIMPLE(GetNamedStringivARB);
String result(len, '\0');
OGLPLUS_GLFUNC(GetNamedStringARB)(
GLint(name.size()),
name.c_str(),
len,
&len,
&result.front()
);
OGLPLUS_CHECK_SIMPLE(GetNamedStringARB);
return std::move(result);
}