本文整理汇总了C++中QOpenGLFramebufferObjectFormat::setTextureTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ QOpenGLFramebufferObjectFormat::setTextureTarget方法的具体用法?C++ QOpenGLFramebufferObjectFormat::setTextureTarget怎么用?C++ QOpenGLFramebufferObjectFormat::setTextureTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QOpenGLFramebufferObjectFormat
的用法示例。
在下文中一共展示了QOpenGLFramebufferObjectFormat::setTextureTarget方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sipNoMethod
static PyObject *meth_QOpenGLFramebufferObjectFormat_setTextureTarget(PyObject *sipSelf, PyObject *sipArgs)
{
PyObject *sipParseErr = NULL;
{
GLenum a0;
QOpenGLFramebufferObjectFormat *sipCpp;
if (sipParseArgs(&sipParseErr, sipArgs, "Bu", &sipSelf, sipType_QOpenGLFramebufferObjectFormat, &sipCpp, &a0))
{
sipCpp->setTextureTarget(a0);
Py_INCREF(Py_None);
return Py_None;
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipParseErr, sipName_QOpenGLFramebufferObjectFormat, sipName_setTextureTarget, doc_QOpenGLFramebufferObjectFormat_setTextureTarget);
return NULL;
}
示例2: indexAt
int indexAt( /*GLuint *buffer,*/ NifModel * model, Scene * scene, QList<DrawFunc> drawFunc, int cycle, const QPoint & pos, int & furn )
{
Q_UNUSED( model ); Q_UNUSED( cycle );
// Color Key O(1) selection
// Open GL 3.0 says glRenderMode is deprecated
// ATI OpenGL API implementation of GL_SELECT corrupts NifSkope memory
//
// Create FBO for sharp edges and no shading.
// Texturing, blending, dithering, lighting and smooth shading should be disabled.
// The FBO can be used for the drawing operations to keep the drawing operations invisible to the user.
GLint viewport[4];
glGetIntegerv( GL_VIEWPORT, viewport );
// Create new FBO with multisampling disabled
QOpenGLFramebufferObjectFormat fboFmt;
fboFmt.setTextureTarget( GL_TEXTURE_2D );
fboFmt.setInternalTextureFormat( GL_RGB32F_ARB );
fboFmt.setAttachment( QOpenGLFramebufferObject::Attachment::CombinedDepthStencil );
QOpenGLFramebufferObject fbo( viewport[2], viewport[3], fboFmt );
fbo.bind();
glEnable( GL_LIGHTING );
glDisable( GL_MULTISAMPLE );
glDisable( GL_MULTISAMPLE_ARB );
glDisable( GL_LINE_SMOOTH );
glDisable( GL_POINT_SMOOTH );
glDisable( GL_POLYGON_SMOOTH );
glDisable( GL_TEXTURE_1D );
glDisable( GL_TEXTURE_2D );
glDisable( GL_TEXTURE_3D );
glDisable( GL_BLEND );
glDisable( GL_DITHER );
glDisable( GL_FOG );
glDisable( GL_LIGHTING );
glShadeModel( GL_FLAT );
glEnable( GL_DEPTH_TEST );
glDepthFunc( GL_LEQUAL );
glClearColor( 0, 0, 0, 1 );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
// Rasterize the scene
Node::SELECTING = 1;
for ( DrawFunc df : drawFunc ) {
(scene->*df)();
}
Node::SELECTING = 0;
fbo.release();
QImage img( fbo.toImage() );
QColor pixel = img.pixel( pos );
#ifndef QT_NO_DEBUG
img.save( "fbo.png" );
#endif
// Encode RGB to Int
int a = 0;
a |= pixel.red() << 0;
a |= pixel.green() << 8;
a |= pixel.blue() << 16;
// Decode:
// R = (id & 0x000000FF) >> 0
// G = (id & 0x0000FF00) >> 8
// B = (id & 0x00FF0000) >> 16
int choose = COLORKEY2ID( a );
// Pick BSFurnitureMarker
if ( choose > 0 ) {
auto furnBlock = model->getBlock( model->index( 3, 0, model->getBlock( choose & 0x0ffff ) ), "BSFurnitureMarker" );
if ( furnBlock.isValid() ) {
furn = choose >> 16;
choose &= 0x0ffff;
}