当前位置: 首页>>代码示例>>C++>>正文


C++ operations::disable方法代码示例

本文整理汇总了C++中operations::disable方法的典型用法代码示例。如果您正苦于以下问题:C++ operations::disable方法的具体用法?C++ operations::disable怎么用?C++ operations::disable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在operations的用法示例。


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

示例1: scale

	example_texgen(void)
	 : scale(1.0f)
	 , aspect(1.0f)
	{
		gl.uniform(erg.scale_loc, scale, scale);
		gl.disable(GL.depth_test);
	}
开发者ID:matus-chochlik,项目名称:oglplu2,代码行数:7,代码来源:008_texgen.cpp

示例2: background

	lighting_example(
		const example_params& params,
		const example_state_view& state,
		eagine::memory::buffer& temp_buffer
	): erase_prog(params)
	 , light_prog(params)
	 , background(
		temp_buffer,
		(shapes::vertex_attrib_kind::position  |0),
		36, 72
	), shape(
		temp_buffer,
		(shapes::vertex_attrib_kind::position  |0)+
		(shapes::vertex_attrib_kind::normal    |1)+
		(shapes::vertex_attrib_kind::wrap_coord|2),
		96, 144
	), shp_turns(0.0f)
	 , cam_orbit(0.0f)
	 , cam_turns(0.0f)
	 , cam_pitch(0.5f)
	 , cam_dist_dir(-1)
	 , cam_turn_dir(1)
	 , cam_elev_dir(1)
	{
		gl.clear_depth(1);
		gl.disable(GL.cull_face);

		set_projection(state);
	}
开发者ID:matus-chochlik,项目名称:oglplu2,代码行数:29,代码来源:028_lighting.cpp

示例3: tex

	example_voronoi(const example_params& params)
	 : tex(params)
	 , prog(params)
	 , screen(prog)
	 , ofs_x_dir(1.f)
	 , ofs_y_dir(1.f)
	 , offset_x(-0.5f)
	 , offset_y(0.0f)
	 , scale_dir(1.f)
	 , scale(10.0f)
	 , aspect(1.0f)
	{

		gl.disable(GL.depth_test);
	}
开发者ID:matus-chochlik,项目名称:oglplu2,代码行数:15,代码来源:014_voronoi.cpp

示例4: render

	void render(const example_state_view& state)
	override
	{
		gl.use(erase_prog);
		gl.disable(GL.depth_test);
		background.use();
		background.draw();

		shp_turns += 0.1f*state.frame_duration().value();

		gl.use(light_prog);
		gl.uniform(
			light_prog.modelview,
			matrix_rotation_x(turns_(shp_turns)/1)*
			matrix_rotation_y(turns_(shp_turns)/2)*
			matrix_rotation_z(turns_(shp_turns)/3)
		);

		gl.clear(GL.depth_buffer_bit);
		gl.enable(GL.depth_test);
		shape.use();
		shape.draw();
	}
开发者ID:matus-chochlik,项目名称:oglplu2,代码行数:23,代码来源:028_lighting.cpp

示例5: vs


//.........这里部分代码省略.........
		"in vec2 vertCoord;\n"
		"out vec4 fragColor;\n"
		"void main(void)\n"
		"{\n"
		"	vec2 z = vec2(0.0, 0.0);\n"
		"	vec2 c = vertCoord;\n"
		"	int i = 0, max = 256;\n"
		"	while((i != max) && (distance(z, c) < 2.0))\n"
		"	{\n"
		"		vec2 zn = vec2(\n"
		"			z.x * z.x - z.y * z.y + c.x,\n"
		"			2.0 * z.x * z.y + c.y\n"
		"		);\n"
		"		z = zn;\n"
		"		++i;\n"
		"	}\n"
		"	float a = float(i)/float(max);\n"
		"	fragColor = texture(gradient, a+sqrt(length(c))*0.1);\n"
		"} \n"
		));
		fs.compile();

		prog.attach(vs);
		prog.attach(fs);
		prog.link();

		gl.use(prog);

		gl.query_location(offset_loc, prog, "Offset");
		gl.query_location(scale_loc, prog, "Scale");
		gl.uniform(offset_loc, offset_x, offset_y);


		gl.bind(vao);

		GLfloat position_data[4*2] = {
			-1.0f, -1.0f,
			-1.0f,  1.0f,
			 1.0f, -1.0f,
			 1.0f,  1.0f
		};

		gl.bind(GL.array_buffer, positions);
		gl.buffer_data(GL.array_buffer, position_data, GL.static_draw);

		vertex_attrib_location va_p;
		gl.query_location(va_p, prog, "Position");
		gl.vertex_array_attrib_pointer(
			va_p,
			2, GL.float_,
			false, 0, nullptr
		);
		gl.enable_vertex_array_attrib(va_p);


		GLfloat coord_data[4*2] = {
			-1.0f, -1.0f,
			-1.0f,  1.0f,
			 1.0f, -1.0f,
			 1.0f,  1.0f
		};

		gl.bind(GL.array_buffer, coords);
		gl.buffer_data(GL.array_buffer, coord_data, GL.static_draw);

		vertex_attrib_location va_c;
		gl.query_location(va_c, prog, "Coord");
		gl.vertex_array_attrib_pointer(
			va_c,
			2, GL.float_,
			false, 0, nullptr
		);
		gl.enable_vertex_array_attrib(va_c);

		GLfloat gradient_data[8*3];

		for(int i=0; i<8*3; ++i)
		{
			gradient_data[i] = (std::rand() % 10000) / 10000.f;
		}

		gl.bind(GL.texture_1d, gradient);
		gl.texture_min_filter(GL.texture_1d, GL.linear);
		gl.texture_mag_filter(GL.texture_1d, GL.linear);
		gl.texture_wrap(
			GL.texture_1d,
			GL.texture_wrap_s,
			GL.repeat
		);
		gl.texture_image_1d(
			GL.texture_1d,
			0, GL.rgb,
			8,
			0, GL.rgb,
			GL.float_,
			const_memory_block{gradient_data}
		);

		gl.disable(GL.depth_test);
	}
开发者ID:deranen,项目名称:oglplu2,代码行数:101,代码来源:011_mandelbrot.cpp


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