• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ vsx_texture类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: start

void start() {

  which_buffer = false;
  texture = new vsx_texture;
  texture->init_color_depth_buffer(res_x,res_x);
  texture->valid = false;
  texture_result->set(texture);

  texture2 = new vsx_texture;
  texture2->init_color_depth_buffer(res_x,res_x);
  texture2->valid = false;
}
开发者ID:Spartan190,项目名称:vsxu,代码行数:12,代码来源:main.cpp


示例2: run

void vsx_module_texture_rotate::run() {
//printf("rotate_begin\n");

	vsx_texture** texture_info_in = texture_info_param_in->get_addr();
	//printf("validness: %d\n",texture_info_param_in->valid);
//	if (texture_info_in->valid)
  if (texture_info_in)
  {

    texture_out->valid = (*texture_info_in)->valid;

//	if (texture_info_in->texture_info) {
  	texture_out->texture_info = (*texture_info_in)->texture_info;
//  }

  	float x = rotation_axis->get(0);
  	float y = rotation_axis->get(1);
  	float z = rotation_axis->get(2);
  	float a = rotation_angle->get()*360;
  	vsx_transform_obj* prev_transform = (*texture_info_in)->get_transform();
  	transform.set_previous_transform(prev_transform);
  	transform.update(a, x, y, z);
    //	if (texture_out)
  	texture_out->set_transform(&transform);
  	((vsx_module_param_texture*)texture_result)->set(texture_out);
  }	else {
    //printf("fooble\n");
    texture_result->valid = false;
  }
}
开发者ID:datar-pl,项目名称:vsxu,代码行数:30,代码来源:main.cpp


示例3: deactivate_offscreen

void deactivate_offscreen()
{
  if ( atof((char*)glGetString(GL_VERSION)) >= 2.0 )
    glUseProgram(glsl_prog);
  else
    glUseProgramObjectARB(glsl_prog);

  if (!which_buffer || support_feedback_int == 0)
  {
    if (texture)
    {
      texture->end_capture_to_buffer();
      texture->valid = true;
    }
    ((vsx_module_param_texture*)texture_result)->set(texture);
  }
  else
  {
    if (texture2)
    {
      texture2->end_capture_to_buffer();
      texture2->valid = true;
    }
    ((vsx_module_param_texture*)texture_result)->set(texture2);
  }

  which_buffer = !which_buffer;

  #if defined(VSXU_OPENGL_ES) || defined (__APPLE__)
  //printf("resetting viewport to %d %d %d %d\n",viewport[0],viewport[1],viewport[2],viewport[3]);
  glViewport(viewport[0],viewport[1],viewport[2],viewport[3]);
  #endif
}
开发者ID:molton,项目名称:vsxu,代码行数:33,代码来源:main.cpp


示例4: stop

void stop() {
  if (texture) {
    texture->deinit_buffer();
    #ifdef VSXU_DEBUG
      printf("deleting texture\n");
    #endif
    delete texture;
    texture = 0;

    if (allocate_second_texture && texture2) {
      texture2->deinit_buffer();
      delete texture2;
      texture2 = 0;
    }
  }
}
开发者ID:datar-pl,项目名称:vsxu,代码行数:16,代码来源:main.cpp


示例5: declare_params

	void declare_params(vsx_module_param_list& in_parameters, vsx_module_param_list& out_parameters) {
		texture_a_in = (vsx_module_param_texture*)in_parameters.create(VSX_MODULE_PARAM_ID_TEXTURE, "texture_a_in");
		texture_b_in = (vsx_module_param_texture*)in_parameters.create(VSX_MODULE_PARAM_ID_TEXTURE, "texture_b_in");

		fade_pos_from_engine = (vsx_module_param_float*)in_parameters.create(VSX_MODULE_PARAM_ID_FLOAT, "fade_pos_from_engine");
		fade_pos_in = (vsx_module_param_float*)in_parameters.create(VSX_MODULE_PARAM_ID_FLOAT, "fade_pos_in");
		fade_pos_out = (vsx_module_param_float*)out_parameters.create(VSX_MODULE_PARAM_ID_FLOAT, "fade_pos_out");
		fade_pos_out->set(0.0f);

		texture_a_out = (vsx_module_param_texture*)out_parameters.create(VSX_MODULE_PARAM_ID_TEXTURE, "texture_a_out");
		texture_b_out = (vsx_module_param_texture*)out_parameters.create(VSX_MODULE_PARAM_ID_TEXTURE, "texture_b_out");

		ab.bpp = 4;
		ab.bformat = GL_RGBA;
		ab.size_x = ab.size_y = 2;
    ab.data = new vsx_bitmap_32bt[4];
    ((vsx_bitmap_32bt*)ab.data)[0] = 0xFFFF0000;
    ((vsx_bitmap_32bt*)ab.data)[1] = 0xFF000000;
    ((vsx_bitmap_32bt*)ab.data)[2] = 0xFF000000;
    ((vsx_bitmap_32bt*)ab.data)[3] = 0xFFFF0000;
		ab.valid = true;

		bb.bpp = 4;
		bb.bformat = GL_RGBA;
		bb.size_x = bb.size_y = 2;
    bb.data = new vsx_bitmap_32bt[4];
    ((vsx_bitmap_32bt*)bb.data)[0] = 0xFF000000;
    ((vsx_bitmap_32bt*)bb.data)[1] = 0xFF0000FF;
    ((vsx_bitmap_32bt*)bb.data)[2] = 0xFF0000FF;
    ((vsx_bitmap_32bt*)bb.data)[3] = 0xFF000000;
		bb.valid = true;

		texture_a.locked = true;
	  texture_a.init_opengl_texture();

		texture_b.locked = true;
	  texture_b.init_opengl_texture();

		texture_a.upload_ram_bitmap(&ab,false);
		texture_b.upload_ram_bitmap(&bb,false);

		texture_a_out->set(&texture_a);
		texture_b_out->set(&texture_b);
	}
开发者ID:datar-pl,项目名称:vsxu,代码行数:44,代码来源:main.cpp


示例6: stop

 void stop()
 {
   if (texture)
   {
     texture->deinit_buffer();
     #ifdef VSXU_DEBUG
       printf("deleting texture\n");
     #endif
     delete texture;
     texture = 0;
   }
 }
开发者ID:Spartan190,项目名称:vsxu,代码行数:12,代码来源:main.cpp


示例7: activate_offscreen

bool activate_offscreen() {
  //printf("ac1\n");
  //printf("activate offscreen\n");
  //glGetIntegerv(GL_VIEWPORT, viewport);
  //printf("old viewport is %d %d %d %d\n",viewport[0],viewport[1],viewport[2],viewport[3]);
#if defined(VSXU_OPENGL_ES) || defined (__APPLE__)
  glGetIntegerv (GL_VIEWPORT, viewport);
#endif

  bool rebuild = false;

  if (alpha_channel->get() != alpha_channel_int)
  {
    alpha_channel_int = alpha_channel->get();
    rebuild = true;
  }

  if (float_texture->get() != float_texture_int)
  {
    float_texture_int = float_texture->get();
    rebuild = true;
  }

  if (texture_size->get() >= 10)
  {
    glGetIntegerv (GL_VIEWPORT, viewport);
    int t_res_x = abs(viewport[2] - viewport[0]);
    int t_res_y = abs(viewport[3] - viewport[1]);

    if (texture_size->get() == 10) {
      if (t_res_x != res_x || t_res_y != res_y) rebuild = true;
    }

    if (texture_size->get() == 11) {
      if (t_res_x / 2 != res_x || t_res_y / 2 != res_y) rebuild = true;
    }

    if (texture_size->get() == 12) {
      if (t_res_x / 4 != res_x || t_res_y / 4 != res_y) rebuild = true;
    }

    if (texture_size->get() == 13) {
      if (t_res_x * 2 != res_x || t_res_y * 2 != res_y) rebuild = true;
    }

    if (texture_size->get() == 14) {
      if (t_res_x * 4 != res_x || t_res_y * 4 != res_y) rebuild = true;
    }
  }


  if (texture_size->get() != tex_size_internal || rebuild) {
    //printf("generating new framebuffer\n");
    tex_size_internal = texture_size->get();
    switch (tex_size_internal) {
      case 0: res_y = res_x = 2048; break;
      case 1: res_y = res_x = 1024; break;
      case 2: res_y = res_x = 512; break;
      case 3: res_y = res_x = 256; break;
      case 4: res_y = res_x = 128; break;
      case 5: res_y = res_x = 64; break;
      case 6: res_y = res_x = 32; break;
      case 7: res_y = res_x = 16; break;
      case 8: res_y = res_x = 8; break;
      case 9: res_y = res_x = 4; break;
      case 10: res_x = abs(viewport[2] - viewport[0]); res_y = abs(viewport[3] - viewport[1]); break;
      case 11: res_x = abs(viewport[2] - viewport[0]) / 2; res_y = abs(viewport[3] - viewport[1]) / 2; break;
      case 12: res_x = abs(viewport[2] - viewport[0]) / 4; res_y = abs(viewport[3] - viewport[1]) / 4; break;
      case 13: res_x = abs(viewport[2] - viewport[0]) * 2; res_y = abs(viewport[3] - viewport[1]) * 2; break;
      case 14: res_x = abs(viewport[2] - viewport[0]) * 4; res_y = abs(viewport[3] - viewport[1]) * 4; break;
    };

    texture->reinit_buffer(res_x, res_y,float_texture->get(),alpha_channel->get());
    if (support_feedback->get())
    texture2->reinit_buffer(res_x, res_y, float_texture->get(),alpha_channel->get());
  }

  if (!which_buffer || support_feedback->get() == 0)
    texture->begin_capture();
  else
    texture2->begin_capture();

  //printf("changing viewport to %d\n",res_x);
	glViewport(0,0,res_x,res_y);
	glDepthMask(GL_TRUE);
	//glDisable(GL_DEPTH_TEST);
	glClearColor(clear_color->get(0),clear_color->get(1),clear_color->get(2),clear_color->get(3));
  //printf("clear buffer\n");
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);		// Clear Screen And Depth Buffer
//#ifdef __APPLE__
	glEnable(GL_BLEND);
//#endif
  glGetIntegerv(GL_CURRENT_PROGRAM, (GLint*)&glsl_prog);
  glUseProgram(0);
  //glBlendFunc(GL_SRC_ALPHA,GL_ONE);
  loading_done = true;
  return true;
};
开发者ID:datar-pl,项目名称:vsxu,代码行数:98,代码来源:main.cpp


示例8: activate_offscreen

  bool activate_offscreen() {
    #if defined(VSXU_OPENGL_ES) || defined (__APPLE__)
      glGetIntegerv (GL_VIEWPORT, viewport);
    #endif

    bool rebuild = false;

    if (alpha_channel->get() != alpha_channel_int)
    {
      alpha_channel_int = alpha_channel->get();
      rebuild = true;
    }

    if (float_texture->get() != float_texture_int)
    {
      float_texture_int = float_texture->get();
      rebuild = true;
    }

    if (multisample->get() != multisample_int)
    {
      multisample_int = multisample->get();
      rebuild = true;
    }

    if (multisample->get() != multisample_int)
    {
      multisample_int = multisample->get();
      rebuild = true;
    }

    if (texture_size->get() >= 10)
    {
      glGetIntegerv (GL_VIEWPORT, viewport);
      int t_res_x = abs(viewport[2] - viewport[0]);
      int t_res_y = abs(viewport[3] - viewport[1]);

      if (texture_size->get() == 10) {
        if (t_res_x != res_x || t_res_y != res_y) rebuild = true;
      }

      if (texture_size->get() == 11) {
        if (t_res_x / 2 != res_x || t_res_y / 2 != res_y) rebuild = true;
      }

      if (texture_size->get() == 12) {
        if (t_res_x / 4 != res_x || t_res_y / 4 != res_y) rebuild = true;
      }

      if (texture_size->get() == 13) {
        if (t_res_x * 2 != res_x || t_res_y * 2 != res_y) rebuild = true;
      }

      if (texture_size->get() == 14) {
        if (t_res_x * 4 != res_x || t_res_y * 4 != res_y) rebuild = true;
      }
    }


    if (texture_size->get() != tex_size_internal || rebuild)
    {
      //printf("generating new framebuffer\n");
      tex_size_internal = texture_size->get();
      switch (tex_size_internal) {
        case 0: res_y = res_x = 2048; break;
        case 1: res_y = res_x = 1024; break;
        case 2: res_y = res_x = 512; break;
        case 3: res_y = res_x = 256; break;
        case 4: res_y = res_x = 128; break;
        case 5: res_y = res_x = 64; break;
        case 6: res_y = res_x = 32; break;
        case 7: res_y = res_x = 16; break;
        case 8: res_y = res_x = 8; break;
        case 9: res_y = res_x = 4; break;
        case 10: res_x = abs(viewport[2] - viewport[0]); res_y = abs(viewport[3] - viewport[1]); break;
        case 11: res_x = abs(viewport[2] - viewport[0]) / 2; res_y = abs(viewport[3] - viewport[1]) / 2; break;
        case 12: res_x = abs(viewport[2] - viewport[0]) / 4; res_y = abs(viewport[3] - viewport[1]) / 4; break;
        case 13: res_x = abs(viewport[2] - viewport[0]) * 2; res_y = abs(viewport[3] - viewport[1]) * 2; break;
        case 14: res_x = abs(viewport[2] - viewport[0]) * 4; res_y = abs(viewport[3] - viewport[1]) * 4; break;
      };

      texture->reinit_color_depth_buffer
      (
        res_x,
        res_y,
        float_texture_int,
        alpha_channel_int,
        multisample_int
      );
    }

    texture->begin_capture_to_buffer();

    //printf("changing viewport to %d\n",res_x);
    glViewport(0,0,res_x,res_y);
    glDepthMask(GL_TRUE);

    glEnable(GL_BLEND);
    glGetIntegerv(GL_CURRENT_PROGRAM, (GLint*)&glsl_prog);
    if ( atof((char*)glGetString(GL_VERSION)) >= 2.0 )
//.........这里部分代码省略.........
开发者ID:Spartan190,项目名称:vsxu,代码行数:101,代码来源:main.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ vtkSmartPointer类代码示例发布时间:2022-05-31
下一篇:
C++ vsx_module_param_texture类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap