本文整理汇总了C++中BX_UNUSED函数的典型用法代码示例。如果您正苦于以下问题:C++ BX_UNUSED函数的具体用法?C++ BX_UNUSED怎么用?C++ BX_UNUSED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BX_UNUSED函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setMouseLock
void setMouseLock(WindowHandle _handle, bool _lock)
{
BX_UNUSED(_handle, _lock);
}
示例2: fscanf
extern "C" int fscanf(FILE* _stream, const char* _format, ...)
{
BX_UNUSED(_stream, _format);
return -1;
}
示例3: fclose
extern "C" int fclose(FILE* _stream)
{
BX_UNUSED(_stream);
return -1;
}
示例4: closedir
extern "C" int closedir (struct DIR* dirp)
{
BX_UNUSED(dirp);
return 0;
}
示例5: vfprintf
extern "C" int vfprintf(FILE* _stream, const char* _format, va_list _argList)
{
BX_UNUSED(_stream, _format, _argList);
return -1;
}
示例6: acosf
extern "C" float acosf(float _x)
{
BX_UNUSED(_x);
return 0.0f;
}
示例7: opendir
extern "C" struct DIR* opendir(const char* dirname)
{
BX_UNUSED(dirname);
return NULL;
}
示例8: ldexp
extern "C" double ldexp(double _x, int _exp)
{
BX_UNUSED(_x, _exp);
return 0.0;
}
示例9: log10f
extern "C" float log10f(float _x)
{
BX_UNUSED(_x);
return 0.0f;
}
示例10: strdup
extern "C" char* strdup(const char* _src)
{
BX_UNUSED(_src);
return NULL;
}
示例11: strtol
extern "C" long int strtol(const char* _str, char** _end, int _base)
{
BX_UNUSED(_str, _end, _base);
return -1;
}
示例12: mbstowcs
extern "C" size_t mbstowcs(wchar_t* _dst, const char* _src, size_t _max)
{
BX_UNUSED(_dst, _src, _max);
return 0;
}
示例13: objToBin
uint32_t objToBin(const uint8_t* _objData
, bx::WriterSeekerI* _writer
, uint32_t _packUv
, uint32_t _packNormal
, bool _ccw
, bool _flipV
, bool _hasTangent
, float _scale
)
{
int64_t parseElapsed = -bx::getHPCounter();
int64_t triReorderElapsed = 0;
const int64_t begin = _writer->seek();
Vector3Array positions;
Vector3Array normals;
Vector3Array texcoords;
Index3Map indexMap;
TriangleArray triangles;
BgfxGroupArray groups;
uint32_t num = 0;
MeshGroup group;
group.m_startTriangle = 0;
group.m_numTriangles = 0;
group.m_name = "";
group.m_material = "";
char commandLine[2048];
uint32_t len = sizeof(commandLine);
int argc;
char* argv[64];
const char* next = (const char*)_objData;
do
{
next = bx::tokenizeCommandLine(next, commandLine, len, argc, argv, BX_COUNTOF(argv), '\n');
if (0 < argc)
{
if (0 == strcmp(argv[0], "#") )
{
if (2 < argc
&& 0 == strcmp(argv[2], "polygons") )
{
}
}
else if (0 == strcmp(argv[0], "f") )
{
Triangle triangle;
memset(&triangle, 0, sizeof(Triangle) );
const int numNormals = (int)normals.size();
const int numTexcoords = (int)texcoords.size();
const int numPositions = (int)positions.size();
for (uint32_t edge = 0, numEdges = argc-1; edge < numEdges; ++edge)
{
Index3 index;
index.m_texcoord = 0;
index.m_normal = 0;
index.m_vertexIndex = -1;
char* vertex = argv[edge+1];
char* texcoord = strchr(vertex, '/');
if (NULL != texcoord)
{
*texcoord++ = '\0';
char* normal = strchr(texcoord, '/');
if (NULL != normal)
{
*normal++ = '\0';
const int nn = atoi(normal);
index.m_normal = (nn < 0) ? nn+numNormals : nn-1;
}
const int tex = atoi(texcoord);
index.m_texcoord = (tex < 0) ? tex+numTexcoords : tex-1;
}
const int pos = atoi(vertex);
index.m_position = (pos < 0) ? pos+numPositions : pos-1;
uint64_t hash0 = index.m_position;
uint64_t hash1 = uint64_t(index.m_texcoord)<<20;
uint64_t hash2 = uint64_t(index.m_normal)<<40;
uint64_t hash = hash0^hash1^hash2;
CS_STL::pair<Index3Map::iterator, bool> result = indexMap.insert(CS_STL::make_pair(hash, index) );
if (!result.second)
{
Index3& oldIndex = result.first->second;
BX_UNUSED(oldIndex);
BX_CHECK(oldIndex.m_position == index.m_position
&& oldIndex.m_texcoord == index.m_texcoord
&& oldIndex.m_normal == index.m_normal
, "Hash collision!"
);
}
//.........这里部分代码省略.........
示例14: BGFX_FATAL
//.........这里部分代码省略.........
);
HDC hdc = GetDC(hwnd);
BGFX_FATAL(NULL != hdc, Fatal::UnableToInitialize, "GetDC failed!");
HGLRC context = createContext(hdc);
wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)wglGetProcAddress("wglCreateContextAttribsARB");
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
if (NULL != wglGetExtensionsStringARB)
{
const char* extensions = (const char*)wglGetExtensionsStringARB(hdc);
BX_TRACE("WGL extensions:");
dumpExtensions(extensions);
}
if (NULL != wglChoosePixelFormatARB
&& NULL != wglCreateContextAttribsARB)
{
int32_t attrs[] =
{
WGL_SAMPLE_BUFFERS_ARB, 0,
WGL_SAMPLES_ARB, 0,
WGL_SUPPORT_OPENGL_ARB, true,
WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB,
WGL_DRAW_TO_WINDOW_ARB, true,
WGL_DOUBLE_BUFFER_ARB, true,
WGL_COLOR_BITS_ARB, 32,
WGL_DEPTH_BITS_ARB, 24,
WGL_STENCIL_BITS_ARB, 8,
0
};
int result;
int pixelFormat;
uint32_t numFormats = 0;
do
{
result = wglChoosePixelFormatARB(m_hdc, attrs, NULL, 1, &pixelFormat, &numFormats);
if (0 == result
|| 0 == numFormats)
{
attrs[3] >>= 1;
attrs[1] = attrs[3] == 0 ? 0 : 1;
}
} while (0 == numFormats);
PIXELFORMATDESCRIPTOR pfd;
DescribePixelFormat(m_hdc, pixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
BX_TRACE("Pixel format:\n"
"\tiPixelType %d\n"
"\tcColorBits %d\n"
"\tcAlphaBits %d\n"
"\tcDepthBits %d\n"
"\tcStencilBits %d\n"
, pfd.iPixelType
, pfd.cColorBits
, pfd.cAlphaBits
, pfd.cDepthBits
, pfd.cStencilBits
);
result = SetPixelFormat(m_hdc, pixelFormat, &pfd);
// When window is created by SDL and SDL_WINDOW_OPENGL is set SetPixelFormat
// will fail. Just warn and continue. In case it failed for some other reason
// create context will fail and it will error out there.
BX_WARN(result, "SetPixelFormat failed (last err: 0x%08x)!", GetLastError() );
uint32_t flags = BGFX_CONFIG_DEBUG ? WGL_CONTEXT_DEBUG_BIT_ARB : 0;
BX_UNUSED(flags);
int32_t contextAttrs[9] =
{
#if BGFX_CONFIG_RENDERER_OPENGL >= 31
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 1,
WGL_CONTEXT_FLAGS_ARB, flags,
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
#else
WGL_CONTEXT_MAJOR_VERSION_ARB, 2,
WGL_CONTEXT_MINOR_VERSION_ARB, 1,
0, 0,
0, 0,
#endif // BGFX_CONFIG_RENDERER_OPENGL >= 31
0
};
m_context = wglCreateContextAttribsARB(m_hdc, 0, contextAttrs);
if (NULL == m_context)
{
// nVidia doesn't like context profile mask for contexts below 3.2?
contextAttrs[6] = WGL_CONTEXT_PROFILE_MASK_ARB == contextAttrs[6] ? 0 : contextAttrs[6];
m_context = wglCreateContextAttribsARB(m_hdc, 0, contextAttrs);
}
BGFX_FATAL(NULL != m_context, Fatal::UnableToInitialize, "Failed to create context 0x%08x.", GetLastError() );
}
示例15: floorf
extern "C" float floorf(float _x)
{
BX_UNUSED(_x);
return 0.0f;
}