当前位置: 首页 > news >正文

教育类网站开发费用哪些公司做DZ网站维护

教育类网站开发费用,哪些公司做DZ网站维护,网站二维码特效,建筑木模板厂家文章目录 前言一、使用gstreamer 获取 pattern 图片二、代码实例1. pattern 图片作为纹理数据源的代码实例1.1 基于opengles2.0 接口的 egl_wayland_texture2_1.c1.2 基于opengles3.0 接口的 egl_wayland_texture3_1.c2. xdg-shell-client-protocol.h 和 xdg-shell-protocol.c3… 文章目录 前言一、使用gstreamer 获取 pattern 图片二、代码实例1. pattern 图片作为纹理数据源的代码实例1.1 基于opengles2.0 接口的 egl_wayland_texture2_1.c1.2 基于opengles3.0 接口的 egl_wayland_texture3_1.c 2. xdg-shell-client-protocol.h 和 xdg-shell-protocol.c3. 编译4. 运行 总结参考资料 前言 本文主要介绍如何在一个wayland client 里面使用 egl + opengles 读取一个 pattern 图片数据进行纹理贴图,在阅读本篇文章之前,建议先读一下之前的文章 《wayland(xdg_wm_base) + egl + opengles 最简实例(一)》 软硬件环境 硬件:PC 软件:ubuntu22.04 weston9.0 opengles2.0/3.0 egl1.4 一、使用gstreamer 获取 pattern 图片 在ubuntu 下执行如下命令可以获取一张格式为RGB888, 分辨率为640x480 的pattern 图片 gst-launch-1.0 videotestsrc num-buffers=1 foreground-color=0 ! video/x-raw,format=RGB, width=640,height=480 ! filesink location=./pattern_640x480.rgb 如下图所示: 在PC 端使用YUV player 软件工具(格式和分辨率分别设置为RGB24和640x480)打开该图片的效果如下图所示 二、代码实例 1. pattern 图片作为纹理数据源的代码实例 1.1 基于opengles2.0 接口的 egl_wayland_texture2_1.c #include wayland-client.h #include wayland-server.h #include wayland-egl.h #include EGL/egl.h #include GLES2/gl2.h #include stdio.h #include stdlib.h #include string.h#include sys/types.h #include sys/stat.h #include fcntl.h #include unistd.h #include "xdg-shell-client-protocol.h"#define WIDTH 800 #define HEIGHT 600struct wl_display *display = NULL; struct wl_compositor *compositor = NULL; struct xdg_wm_base *wm_base = NULL; struct wl_registry *registry = NULL;struct window {struct wl_surface *surface;struct xdg_surface *xdg_surface;struct xdg_toplevel *xdg_toplevel;struct wl_egl_window *egl_window; };// Index to bind the attributes to vertex shaders const unsigned int VertexArray = 0;static void xdg_wm_base_ping(void *data, struct xdg_wm_base *shell, uint32_t serial) {xdg_wm_base_pong(shell, serial); }/*for xdg_wm_base listener*/ static const struct xdg_wm_base_listener wm_base_listener = {xdg_wm_base_ping, };/*for registry listener*/ static void registry_add_object(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) {if (!strcmp(interface, "wl_compositor")) {compositor = wl_registry_bind(registry, name, wl_compositor_interface, 1);} else if (strcmp(interface, "xdg_wm_base") == 0) {wm_base = wl_registry_bind(registry, name,xdg_wm_base_interface, 1);xdg_wm_base_add_listener(wm_base, wm_base_listener, NULL);} }void registry_remove_object(void *data, struct wl_registry *registry, uint32_t name) {}static struct wl_registry_listener registry_listener = {registry_add_object, registry_remove_object};static void handle_surface_configure(void *data, struct xdg_surface *surface,uint32_t serial) {xdg_surface_ack_configure(surface, serial); }static const struct xdg_surface_listener xdg_surface_listener = {handle_surface_configure };static void handle_toplevel_configure(void *data, struct xdg_toplevel *toplevel,int32_t width, int32_t height,struct wl_array *states) { }static void handle_toplevel_close(void *data, struct xdg_toplevel *xdg_toplevel) { }static const struct xdg_toplevel_listener xdg_toplevel_listener = {handle_toplevel_configure,handle_toplevel_close, };bool initWaylandConnection() { if ((display = wl_display_connect(NULL)) == NULL){printf("Failed to connect to Wayland display!\n");return false;}if ((registry = wl_display_get_registry(display)) == NULL){printf("Faield to get Wayland registry!\n");return false;}wl_registry_add_listener(registry, registry_listener, NULL);wl_display_dispatch(display);if (!compositor){printf("Could not bind Wayland protocols!\n");return false;}return true; }bool initializeWindow(struct window *window) {initWaylandConnection();window-surface = wl_compositor_create_surface (compositor);window-xdg_surface = xdg_wm_base_get_xdg_surface(wm_base, window-surface);if (window-xdg_surface == NULL){printf("Failed to get Wayland xdg surface\n");return false;} else {xdg_surface_add_listener(window-xdg_surface, xdg_surface_listener, window);window-xdg_toplevel =xdg_surface_get_toplevel(window-xdg_surface);xdg_toplevel_add_listener(window-xdg_toplevel,xdg_toplevel_listener, window);xdg_toplevel_set_title(window-xdg_toplevel, "egl_wayland_texture");}return true;}void releaseWaylandConnection(struct window *window) {if(window-xdg_toplevel)xdg_toplevel_destroy(window-xdg_toplevel);if(window-xdg_surface)xdg_surface_destroy(window-xdg_surface);wl_surface_destroy(window-surface);xdg_wm_base_destroy(wm_base);wl_compositor_destroy(compositor);wl_registry_destroy(registry);wl_display_disconnect(display); }bool createEGLSurface(EGLDisplay eglDisplay, EGLConfig eglConfig, EGLSurface *eglSurface, struct window *window) {window-egl_window = wl_egl_window_create(window-surface, WIDTH, HEIGHT);if (window-egl_window == EGL_NO_SURFACE) { printf("Can't create egl window\n"); return false;} else {printf("Created wl egl window\n");}*eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, window-egl_window, NULL);return true; }bool create_textures(GLuint *textureId) {GLuint width, height;GLbyte *data;GLint fd;width = 640;height = 480;fd = open("./pattern_640x480.rgb", O_RDONLY);if(fd 0) {printf("open failed\n");return false;}data = (GLbyte *)malloc(width * height * 3);if(
http://www.zqtcl.cn/news/159271/

相关文章:

  • 东莞企业如何建网站网站正在建设中...为什么护卫神
  • 引流用的电影网站怎么做wordpress浏览速度
  • 微信小程序怎拼做搬家网站东莞建网站公司
  • 网站推广昔年下拉博客推广链接制作软件
  • php 小企业网站 cmswordpress导航分类
  • 婚恋网站女孩子都是做美容免费空间最大的网盘
  • 建立网站要钱吗找人做网站需求怎么写
  • 网站建设精品课程电商运营主要负责什么
  • 中职网站建设与维护考试题wordpress商店会员管理
  • 物流网站开发策划做提升自己的网站
  • 网站开发交接做网站首页尺寸大小
  • 临沂建网站公司一个工厂做网站有用吗
  • 网站建设代码编译的问题及解决方案天元建设集团有限公司第六分公司
  • 做亚马逊网站费用深圳好蜘蛛网站建设公司
  • 做网站需要办什么手续html简单网页代码实例
  • 中文网页设计模板免费下载超级优化小说
  • 做网站的流程前端做什么网站建设与管理专业学什么
  • 用wordpress做购物网站西安建设工程网站
  • 响应式网站免费模板下载电商怎么做如何从零开始视频
  • 江西网站开发学校联系我们网站制作
  • 做网站首页图片素材营销网站制作要素
  • 云阳网站建设百度对 wordpress 排名
  • 做电商网站需要多少时间网站建设答辩ppt
  • 营销型网站的案例江苏seo网站排名优化
  • 企业网站 备案 网站名称凡科做视频网站
  • 湘潭建设公司网站杭州网站优化
  • 工信部备案网站网站空间服务商
  • 深圳市企业网站seo营销工具桂林百姓网
  • 网站建设所需材料wordpress nginx配置文件
  • 给企业做网站运营广州制作网站公司