您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GLuint函数代码示例

51自学网 2021-06-01 20:53:29
  C++
这篇教程C++ GLuint函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GLuint函数的典型用法代码示例。如果您正苦于以下问题:C++ GLuint函数的具体用法?C++ GLuint怎么用?C++ GLuint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GLuint函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: init2DTexture

		void init2DTexture(const graphics::Context::InitTextureParams & _params) override		{			if (_params.msaaLevel == 0) {				if (m_handle != _params.handle) {					m_handle = _params.handle;					glTextureStorage2D(GLuint(_params.handle),								   _params.mipMapLevels,								   GLenum(_params.internalFormat),								   _params.width,								   _params.height);				}				if (_params.data != nullptr) {					glTextureSubImage2D(GLuint(_params.handle),						_params.mipMapLevel,						0, 0,						_params.width,						_params.height,						GLuint(_params.format),						GLenum(_params.dataType),						_params.data);				}			}			else {				glTexStorage2DMultisample(GLuint(_params.handle),										  _params.msaaLevel,										  GLenum(_params.internalFormat),										  _params.width,										  _params.height,										  GL_FALSE);			}		}
开发者ID:IlDucci,项目名称:GLideN64,代码行数:33,


示例2: GLuint

void ClusteredLightManager::buildClustering() {  GLuint index = 0;  glm::uvec4 affected_tiles;  glm::uvec3 frustrum_begin;  glm::uvec3 frustrum_end;  for (const world::PointLight* light : this->world.p_lights) {    // calculate tiles effected by light if false then no tiles are affected    // and it can be skipped    if (this->projector.computeProjection(*light,                                          this->view.camera,                                          this->view.viewport,                                          this->tile_size,                                          affected_tiles)) {      frustrum_begin.x = affected_tiles.x;      frustrum_begin.y = affected_tiles.y;      frustrum_end.x = affected_tiles.z;      frustrum_end.y = affected_tiles.w;      // calculate z_value of light in camera space      glm::vec4 light_camera_pos = view.camera.getLookAt() * light->position;      frustrum_begin.z = GLuint(std::max(int(floor(log(-(light_camera_pos.z + light->radius) / view.camera.getDepthrange().x) * this->k_inv_denominator)), 0));      frustrum_end.z = GLuint(std::max(int(floor(log(-(light_camera_pos.z - light->radius) / view.camera.getDepthrange().x) * this->k_inv_denominator)), 0));      this->light_clustering.incrementLight(frustrum_begin,                                            frustrum_end,                                            index);    }    index++;  }}
开发者ID:BeardedPlatypus,项目名称:nTiled_new,代码行数:32,


示例3: snprintf

void RevolverTool::DataItem::writeNumber(const Point& position,int number)	{	/* Convert the number to a string: */	char buffer[20];	snprintf(buffer,sizeof(buffer),"%d",number);		/* Calculate the number's width: */	GLfloat width=-spacing;	for(const char* bPtr=buffer;*bPtr!='/0';++bPtr)		{		int index=*bPtr=='-'?10:int(*bPtr)-int('0');		width+=digitWidths[index];		width+=spacing;		}		/* Write the number: */	glPushMatrix();	glTranslated(position[0]-width*0.5f,position[1],position[2]-digitHeight*0.5f);		for(const char* bPtr=buffer;*bPtr!='/0';++bPtr)		{		GLuint index=*bPtr=='-'?GLuint(10):GLuint(*bPtr)-GLuint('0');		glCallList(digitListBase+index);		glTranslatef(digitWidths[index]+spacing,0.0f,0.0f);		}		glPopMatrix();	}
开发者ID:jrevote,项目名称:3DA-Vrui,代码行数:28,


示例4: getUniformLocation

uint QGLEngineShaderManager::getUniformLocation(Uniform id){    QVector<uint> &uniformLocations = currentShaderProg->uniformLocations;    if (uniformLocations.isEmpty())        uniformLocations.fill(GLuint(-1), NumUniforms);    static const char *uniformNames[] = {        "imageTexture",        "patternColor",        "globalOpacity",        "depth",        "pmvMatrix",        "maskTexture",        "fragmentColor",        "linearData",        "angle",        "halfViewportSize",        "fmp",        "fmp2_m_radius2",        "inverse_2_fmp2_m_radius2",        "invertedTextureSize",        "brushTransform",        "brushTexture"    };    if (uniformLocations.at(id) == GLuint(-1))        uniformLocations[id] = currentShaderProg->program->uniformLocation(uniformNames[id]);    return uniformLocations.at(id);}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:30,


示例5: VertexAttribIOffset

 /**  *  @glsymbols  *  @glfunref{VertexArrayVertexAttribIOffsetEXT}  */ const ObjectOps& VertexAttribIOffset(     BufferName buffer,     VertexAttribSlot location,     GLint values_per_vertex,     DataType data_type,     GLsizei stride,     GLintptr offset ) const {     OGLPLUS_GLFUNC(VertexArrayVertexAttribIOffsetEXT)(         _name,         GetGLName(buffer),         GLuint(location),         values_per_vertex,         GLenum(data_type),         stride,         offset     );     OGLPLUS_CHECK(         VertexArrayVertexAttribIOffsetEXT,         ObjectError,         Object(*this).         Index(GLuint(location))     );     return *this; }
开发者ID:zhengxiuyu,项目名称:PCISPH,代码行数:30,


示例6: SpectraRenderer

SpectraDefaultRenderer::SpectraDefaultRenderer(	SpectraApp& app,	const std::shared_ptr<SpectraSharedObjects>& sh_obj,	const std::shared_ptr<SpectraVisualisation>& doc_vis,	wxGLCanvas* canvas): SpectraRenderer(app, sh_obj, doc_vis, canvas) , doc_vis_prog(Common().BuildProgram("default_doc_vis.prog")) , doc_vis_projection_matrix(doc_vis_prog, "ProjectionMatrix") , doc_vis_camera_matrix(doc_vis_prog, "CameraMatrix") , doc_vis_stretch_matrix(doc_vis_prog, "StretchMatrix") , doc_vis_transf_matrix(doc_vis_prog, "TransfMatrix") , doc_vis_spectrum_tex(doc_vis_prog, "SpectrumTex") , doc_vis_spectrum_size(doc_vis_prog, "SpectrumSize") , doc_vis_samples_per_unit(doc_vis_prog, "SamplesPerUnit") , doc_vis_selected_time(doc_vis_prog, "SelectedTime") , doc_vis_selection_begin(doc_vis_prog, "SelectionBegin") , doc_vis_selection_end(doc_vis_prog, "SelectionEnd") , spectrum_plane_wrap(	Common().SpectrumPlane(		GLuint(DocVis().GridSamples()),		GLuint(DocVis().SignalSpectrumSize())	)), spectrum_plane_vao(spectrum_plane_wrap.VAOForProgram(doc_vis_prog)) , vis_cue_prog(Common().BuildProgram("default_vis_cue.prog")) , vis_cue_projection_matrix(vis_cue_prog, "ProjectionMatrix") , vis_cue_camera_matrix(vis_cue_prog, "CameraMatrix") , vis_cue_stretch_matrix(vis_cue_prog, "StretchMatrix") , vis_cue_transf_matrix(vis_cue_prog, "TransfMatrix") , vis_cue_color(vis_cue_prog, "Color") , vis_cue_alpha(vis_cue_prog, "Alpha") , ground_grid_vao(Common().GroundUnitGrid().VAOForProgram(vis_cue_prog)) , wall_grid_vao(Common().WallUnitGrid().VAOForProgram(vis_cue_prog)){	CacheBgColor();}
开发者ID:AdamSimpson,项目名称:oglplus,代码行数:35,


示例7: assert

Object::~Object(){	assert(this->vertex_array_handle == GLuint(-1));	assert(this->vertex_data_handle == GLuint(-1));	assert(this->normal_array_handle == GLuint(-1));	assert(this->normal_data_handle == GLuint(-1));}
开发者ID:acrlakshman,项目名称:BasicModelViewer,代码行数:7,


示例8: GLuint

void gfx::BloomProgram::Render(){	//Do brightpass	ShaderProgram* prog = g_ShaderBank.GetProgramFromHandle(m_BrightPassShader);	prog->Apply();	const int WORK_GROUP_SIZE = 32;	GLuint WorkGroupSizeX = GLuint((m_Width + WORK_GROUP_SIZE - 1) / float(WORK_GROUP_SIZE));	GLuint WorkGroupSizeY = GLuint((m_Height + WORK_GROUP_SIZE - 1) / float(WORK_GROUP_SIZE));	prog->SetUniformTextureHandle("g_Image", m_TargetTex, 1);	prog->SetUniformVec2("g_ScreenSize", glm::vec2(m_Width, m_Height));	prog->SetUniformFloat("g_Threshold", 0.4f);	prog->SetUniformFloat("g_Smoothness", 0.8f);	glBindImageTexture(0, m_BloomTexture, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_RGBA8);	glDispatchCompute(WorkGroupSizeX, WorkGroupSizeY, 1);	//blur result	m_BlurProgram->Render();	//add to final target	prog = g_ShaderBank.GetProgramFromHandle(m_BloomShader);	prog->Apply();	prog->SetUniformTextureHandle("g_BluredBloomTex", m_BlurProgram->GetBluredTexture(), 1);	prog->SetUniformTextureHandle("g_ColorBuffer", m_TargetTex, 2);	prog->SetUniformVec2("g_ScreenSize", glm::vec2(m_Width, m_Height));	glBindImageTexture(0, m_BloomTexture, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_RGBA8);	glDispatchCompute(WorkGroupSizeX, WorkGroupSizeY, 1);}
开发者ID:toimelin,项目名称:gameenginecourse2015,代码行数:25,


示例9: 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))); }
开发者ID:matus-chochlik,项目名称:oglplus,代码行数:16,


示例10: GLuint

void Object::InternalInitialize(){	this->vertex_array_handle = GLuint(-1);	this->vertex_data_handle = GLuint(-1);	this->vertex_indices_handle = GLuint(-1);	this->vertex_indices_wire_frame_handle = GLuint(-1);	/* TODO: Enable normals too */	this->normal_array_handle = this->normal_data_handle = this->normal_indices_handle = GLuint(-1);}
开发者ID:acrlakshman,项目名称:BasicModelViewer,代码行数:11,


示例11: glDeleteVertexArrays

void Object::takeDown() {	if (this->vertexArrayHandle != GLuint(-1)) {		glDeleteVertexArrays(1, &this->vertexArrayHandle);	}	if (this->vertexBufferHandle != GLuint(-1)) {		glDeleteBuffers(1, &this->vertexBufferHandle);	}	this->vertexArrayHandle = this->vertexBufferHandle = GLuint(-1);}
开发者ID:beamery,项目名称:3D-Texture-Synthesis,代码行数:11,


示例12: run_loop

void run_loop(	std::unique_ptr<Example>& example,	GLuint width,	GLuint height){	GLuint mouse_x = width / 2;	GLuint mouse_y = height / 2;	os::steady_clock os_clock;	ExampleClock clock;	while(true)	{		clock.Update(os_clock.seconds());		if(!example->Continue(clock)) break;		example->Render(clock);		glfwSwapBuffers();		int new_x, new_y;		glfwGetWindowSize(&new_x, &new_y);		if((int(width) != new_x) || (int(height) != new_y))		{			if(new_x <= 0) new_x = 1;			if(new_y <= 0) new_y = 1;			width = GLuint(new_x);			height = GLuint(new_y);			example->Reshape(width, height);		}		glfwGetMousePos(&new_x, &new_y);		if((int(mouse_x) != new_x) || (int(mouse_y) != new_y))		{			if(new_x <= 0) new_x = 1;			if(new_y <= 0) new_y = 1;			mouse_x = GLuint(new_x);			mouse_y = GLuint(new_y);			example->MouseMove(				mouse_x,				height-				mouse_y,				width,				height			);		}		if(glfwGetKey(GLFW_KEY_ESC))		{			glfwCloseWindow();			break;		}		if(!glfwGetWindowParam(GLFW_OPENED))			break;	}}
开发者ID:BrainlessLabsInc,项目名称:oglplus,代码行数:54,


示例13: GLuint

void ComputeShaderChunk::changeFrom(DrawEnv    *pEnv,                                     StateChunk *pOther,                                     UInt32      uiIdx){    ComputeShaderChunk *pOld = dynamic_cast<ComputeShaderChunk *>(pOther);    // pOther can be a ShaderExecutableChunk, since we share the StateClass id    // with it    if(pOld != NULL)    {        Window   *pWin     = pEnv->getWindow();        GLuint    uiProgId = GLuint(pWin->getGLObjectId(getGLId()));        UInt32 uiDep = ShaderProcVariable::SHDObject;        if(uiProgId != pEnv->getActiveShader())        {            UInt32 uiValRes = pWin->validateGLObject(getGLId(),                                                     pEnv,                                                     KeepProgActive);            uiProgId = GLuint(pWin->getGLObjectId(getGLId()));            if(uiProgId == 0)                return;            pEnv->setActiveShader(uiProgId);            if(0x0000 == (uiValRes & ProgActive))            {                OSGGETGLFUNCBYID_GL3_ES(glUseProgram,                                        osgGlUseProgram,                                        ShaderProgram::getFuncIdUseProgram(),                                        pWin);                osgGlUseProgram(uiProgId);            }            uiDep = ShaderProcVariable::SHDAll;            pEnv->incNumShaderChanges();        }        updateProceduralVariables(pEnv, uiDep);    }    else    {        pOther->deactivate(pEnv, uiIdx);        activate          (pEnv, uiIdx);        pEnv->incNumShaderChanges();    }}
开发者ID:jondo2010,项目名称:OpenSG,代码行数:53,


示例14: InstructionsWithAdjacency

	/// Returns the instructions for rendering	DrawingInstructions InstructionsWithAdjacency(void) const	{		const unsigned n = _divisions;		DrawOperation operation;		operation.method = DrawOperation::Method::DrawElements;		operation.mode = PrimitiveType::TrianglesAdjacency;		operation.first = GLuint(0);		operation.count = GLuint(n*n*n*6*6);		operation.restart_index = DrawOperation::NoRestartIndex();		operation.phase = 0;		return this->MakeInstructions(operation);	}
开发者ID:GLDRorg,项目名称:oglplus,代码行数:13,


示例15: update2DTexture

		void update2DTexture(const graphics::Context::UpdateTextureDataParams & _params) override		{			glTextureSubImage2D(GLuint(_params.handle),				_params.mipMapLevel,				_params.x,				_params.y,				_params.width,				_params.height,				GLuint(_params.format),				GLenum(_params.dataType),				_params.data);		}
开发者ID:IlDucci,项目名称:GLideN64,代码行数:12,


示例16: ST_DEBUG_ASSERT

bool StGLMesh::computeNormals(size_t theDelta) {    ST_DEBUG_ASSERT(theDelta > 0);    myNormals.initArray(myVertices.size());    if(myVertices.isEmpty()) {        return false;    }    // iterate over each triangle    // for each node we compute summary of normals for all triangles where this node used    // normals are NOT normalized per triangle - this allows to interpolate result normal    // with respect to each triangle dimensions    GLuint aV1, aV2, aV3;    StGLVec3 aNorm;    if(myIndices.size() >= 3) {        size_t aLimit = myIndices.size() - 3;        for(size_t anIndexId = 0; anIndexId <= aLimit; anIndexId += theDelta) {            aV1 = myIndices[anIndexId];            aV2 = myIndices[anIndexId + 1];            aV3 = myIndices[anIndexId + 2];            const StGLVec3& aVert1 = myVertices[aV1];            const StGLVec3& aVert2 = myVertices[aV2];            const StGLVec3& aVert3 = myVertices[aV3];            aNorm = StGLVec3::cross(aVert2 - aVert1, aVert3 - aVert1);            myNormals.changeValue(aV1) += aNorm;            myNormals.changeValue(aV2) += aNorm;            myNormals.changeValue(aV3) += aNorm;        }    } else if(myVertices.size() >= 3) {        size_t aLimit = myVertices.size() - 3;        for(size_t aVertId = 0; aVertId <= aLimit; aVertId += theDelta) {            aV1 = GLuint(aVertId);            aV2 = GLuint(aVertId + 1);            aV3 = GLuint(aVertId + 2);            const StGLVec3& aVert1 = myVertices[aV1];            const StGLVec3& aVert2 = myVertices[aV2];            const StGLVec3& aVert3 = myVertices[aV3];            aNorm = StGLVec3::cross(aVert2 - aVert1, aVert3 - aVert1);            myNormals.changeValue(aV1) += aNorm;            myNormals.changeValue(aV2) += aNorm;            myNormals.changeValue(aV3) += aNorm;        }    } else {        return false;    }    // normalize normals (important for OpenGL)    for(size_t aNormId = 0; aNormId < myNormals.size(); ++aNormId) {        myNormals.changeValue(aNormId).normalize();    }    return true;}
开发者ID:KindDragon,项目名称:sview,代码行数:51,


示例17: drawOverWater

void Terrain::drawOverWater(){	// bind textures	material->use();	for (int i=0; i<TERRAIN_TEX_COUNT; i++){		textureManager->bindTexture(textureIds[i], GL_TEXTURE0+GLuint(i));	}	textureManager->bindTexture(textureManager->shadowMapID, GL_TEXTURE0+GLuint(7));	shader->use(true);	shader->setUniform4v(border_values_location, g_terrain_border_values);	shader->setUniform4v(border_widths_location, g_terrain_border_widths);	shader->setUniform2f(heightInterval_location, WATER_HEIGHT, 1000.f);	shader->setBoolean(fastModeLoc, g_fastMode);	shader->setBoolean(shadowMappingEnabledLoc, g_ShadowMappingEnabled);	shader->setUniformMatrix(LCmatrixLoc, g_LightMVPCameraVInverseMatrix );	shader->setUniformMatrix(LMV_CVImatrixLoc, g_LightMVCameraVInverseMatrix );	shader->setUniformMatrix(LPmatrixLoc, g_LightPMatrix );		// bind index buffer		glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,eboId);		glBindBuffer(GL_ARRAY_BUFFER, vboId); 		   // enable states			glEnableClientState(GL_VERTEX_ARRAY);			glEnableClientState(GL_NORMAL_ARRAY);			glEnableClientState(GL_TEXTURE_COORD_ARRAY);		   // draw VBOs...			glVertexPointer(channels[VERTEX], glTypes[VERTEX], 0, BUFFER_OFFSET(offsets[VERTEX]));			glNormalPointer(glTypes[NORMAL], 0, BUFFER_OFFSET( offsets[NORMAL] ) );						glActiveTexture(GL_TEXTURE0);			glClientActiveTexture(GL_TEXTURE0);						glTexCoordPointer(channels[TEXCOORD0], glTypes[TEXCOORD0], 0, BUFFER_OFFSET(offsets[TEXCOORD0]));						glDrawElements(GL_TRIANGLE_STRIP, eboCount, GL_UNSIGNED_INT, BUFFER_OFFSET(offsets[INDEX]));					   // disable		   		   glDisableClientState(GL_TEXTURE_COORD_ARRAY);		   glDisableClientState(GL_NORMAL_ARRAY);		   glDisableClientState(GL_VERTEX_ARRAY);		// unbind buffers		glBindBuffer(GL_ARRAY_BUFFER, 0);		glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);		// unbind textures		for (int i=0; i<TERRAIN_TEX_COUNT; i++){			textureManager->unbindTexture(textureIds[i]);		}	// turn off shader	shader->use(false);	flip = false;}
开发者ID:kidd32pg,项目名称:natureal,代码行数:51,


示例18: Binding

	/**	 *  @glsymbols	 *  @glfunref{UniformBlockBinding}	 */	void Binding(UniformBufferBindingPoint binding)	{		OGLPLUS_GLFUNC(UniformBlockBinding)(			this->_program,			this->_location,			GLuint(binding)		);		OGLPLUS_VERIFY(			UniformBlockBinding,			ProgVarError,			Program(ProgramName(this->_program)).			Index(GLuint(binding))		);	}
开发者ID:Simmesimme,项目名称:oglplus,代码行数:18,


示例19: DisableVertexAttrib

 /**  *  @glsymbols  *  @glfunref{DisableVertexArrayAttribEXT}  */ const ObjectOps& DisableVertexAttrib(VertexAttribSlot location) {     OGLPLUS_GLFUNC(DisableVertexArrayAttribEXT)(         _name,         GLuint(location)     );     OGLPLUS_CHECK(         DisableVertexArrayAttribEXT,         ObjectError,         Object(*this).         Index(GLuint(location))     );     return *this; }
开发者ID:zhengxiuyu,项目名称:PCISPH,代码行数:18,


示例20: glDepthMask

void SSAO::Update(const FrameBuffer *FBO, const Camera *camera) const{	ssaoFBO.Bind();	glDepthMask(GL_FALSE);	glDisable(GL_DEPTH_TEST);	Shader *ssao = Manager::Shader->GetShader("ssao");	ssao->Use();	ssao->BindTexturesUnits();	ssaoFBO.SendResolution(ssao);	camera->BindViewMatrix(ssao->loc_view_matrix);	camera->BindProjectionMatrix(ssao->loc_projection_matrix);	camera->BindProjectionDistances(ssao);	glUniform1f(ssao->loc_u_rad, radius);	glUniform1i(ssao->loc_kernel_size, kernelSize);	glUniform3fv(ssao->loc_kernel, kernelSize * 3, glm::value_ptr(kernel[0]));	FBO->BindTexture(3, GL_TEXTURE0);	FBO->BindTexture(4, GL_TEXTURE1);	FBO->BindDepthTexture(GL_TEXTURE2);	RandomNoise1->BindToTextureUnit(GL_TEXTURE3);	RandomNoise2->BindToTextureUnit(GL_TEXTURE4);	ScreenQuad->Render(ssao);	// Finish TASK	glEnable(GL_DEPTH_TEST);	glDepthMask(GL_TRUE);	FrameBuffer::Unbind();	// -- COMPUTE SHADER	int WORK_GROUP_SIZE = 16;	auto res = ssaoFBO.GetResolution();	Shader *S = Manager::Shader->GetShader("ssaoBlur");	S->Use();	// First Pass	ssaoFBO.BindTexture(0, GL_TEXTURE0);		glBindImageTexture(1, computeTexture->GetTextureID(), 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_RGBA16F);	glDispatchCompute(GLuint(UPPER_BOUND(res.x, WORK_GROUP_SIZE)), GLuint(UPPER_BOUND(res.y, WORK_GROUP_SIZE)), 1);	glMemoryBarrier(GL_ALL_BARRIER_BITS);}
开发者ID:IHaveABoom,项目名称:OpenGL4.5-GameEngine,代码行数:48,


示例21: FboBinder

 FboBinder(GLuint handle): prev(0), restore(false) {   glGetIntegerv( GL_FRAMEBUFFER_BINDING_EXT, &prev );   if ( GLuint(prev) != handle ) {     glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, handle );     restore = true;   } }
开发者ID:gprice1,项目名称:chomp,代码行数:7,


示例22: MaxViewports

	/**	 *  @throws Error	 *	 *  @glsymbols	 *  @glfunref{Get}	 *  @gldefref{MAX_VIEWPORTS}	 */	static GLuint MaxViewports(void)	{		GLint result = 0;		OGLPLUS_GLFUNC(GetIntegerv)(GL_MAX_VIEWPORTS, &result);		OGLPLUS_VERIFY_SIMPLE(GetIntegerv);		return GLuint(result);	}
开发者ID:MaikKlein,项目名称:oglplus,代码行数:14,


示例23: GLuint

	int TextureManager::CreateRGBATexture( int width_, int height_, int textureSlot )	{		GLuint colorTexture = GLuint( -1 );		// Activating the texture slot		glActiveTexture( GL_TEXTURE0 + textureSlot );		// Generating the texture		glGenTextures( 1, &colorTexture );						// Binding the texture		glBindTexture( GL_TEXTURE_2D, colorTexture );		// Creating the texture		glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, width_, height_, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL );		// Texture param		glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );		glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); 		glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );		glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );		return colorTexture;	}
开发者ID:rroa,项目名称:Real-time-content-streaming,代码行数:25,


示例24: createTexture3D

/*!    /internal*/QCLImage3D QCLContextGL::createTexture3D    (QMacCompatGLenum type, QMacCompatGLuint texture,     QMacCompatGLint mipmapLevel, QCLMemoryObject::Access access){    return createTexture3D(GLenum(type), GLuint(texture),                           GLint(mipmapLevel), access);}
开发者ID:Dem0n3D,项目名称:qt-opencl,代码行数:10,


示例25: _query_limit

	static GLuint _query_limit(void)	{		GLint limit = 0;		OGLPLUS_GLFUNC(GetIntegerv)(Query, &limit);		OGLPLUS_VERIFY_SIMPLE(GetIntegerv);		return GLuint(limit);	}
开发者ID:xubingyue,项目名称:oglplus,代码行数:7,


示例26: glSelectBuffer

TokenId KPboardView::Selection(const Camera &camera, int x, int y) const{    GLuint  buffer[BUF_SIZE]; // Set Up A Selection Buffer    auto choose = TokenId::EMPTY;    glSelectBuffer(BUF_SIZE, buffer);    glRenderMode(GL_SELECT); // Change to Selection mode    glInitNames();    glPushName(0); // Push 0 (At Least One Entry) Onto The Stack    camera.Draw(x, y);    Draw(true); // Draw the tokens (not the board)    auto hits = glRenderMode(GL_RENDER);  // Change back to render mode    if (hits > 0)    {        choose = static_cast<TokenId>(buffer[3]);        auto depth = buffer[1];        for (auto loop = 1; loop < hits; loop++)        {            if (buffer[loop * 4 + 1] < GLuint(depth))            {                // store the closest object                choose = static_cast<TokenId>(buffer[loop * 4 + 3]);                depth  = buffer[loop * 4 + 1];            }        }    }    return choose;}
开发者ID:aladur,项目名称:khunphan,代码行数:33,


示例27: glSelectBuffer

/// returns the selected face, NULL if nothing selectedview::face* view::get_selected_face(int x, int y) {	GLuint select_buf[SELECT_BUF_SIZE];	glSelectBuffer(SELECT_BUF_SIZE, select_buf);	glRenderMode(GL_SELECT);	glInitNames();	GLdouble projection_matrix[16];	glGetDoublev(GL_PROJECTION_MATRIX, projection_matrix);	glMatrixMode (GL_PROJECTION);	glLoadIdentity ();	GLint viewport[4];	glGetIntegerv(GL_VIEWPORT, viewport);	gluPickMatrix (GLdouble(x), GLdouble(viewport[3] - y), SELECT_TOL, SELECT_TOL, viewport);	glMultMatrixd(projection_matrix);	basemesh_drawable->render_faces();	glMatrixMode(GL_PROJECTION);	glLoadMatrixd(projection_matrix);	glFlush();	GLint hits = glRenderMode(GL_RENDER);	if (hits > 0) {		int selected_face = select_buf[3];		int depth = select_buf[1];		for (int i = 1; i < hits; i++) {			if (select_buf[i*4+1] < GLuint(depth))  {				selected_face = select_buf[i*4+3];				depth = select_buf[i*4+1];			}		}		return (face*)selected_face;	}	return NULL;}
开发者ID:nobbk,项目名称:copo,代码行数:32,


示例28: obj

 model obj(model::attrib_flag_t import_attribs){          model::attrib_flag_t attributes{model::POSITION | import_attribs};          std::vector<float> vertex_data;     std::vector<unsigned> indecs;          GLuint vertex_offset = 0;          int count = 100000;     // push back vertex attributes     for (unsigned i = 0; i < count; ++i) {         vertex_data.push_back((float)((float)(rand() % 100))/10);         vertex_data.push_back((float)((float)(rand() % 150))/10 - 7.0f);         vertex_data.push_back((float)((float)(rand() % 100))/10);     }          // add triangles     for (unsigned i = 0; i < count; ++i) {         indecs.push_back(rand() % 100);     }          vertex_offset += GLuint(count);          return model{vertex_data, attributes, indecs}; }
开发者ID:gegego,项目名称:graphicassigment,代码行数:26,



注:本文中的GLuint函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GMIME_IS_PART函数代码示例
C++ GLua_CheckBitStream函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。