简体   繁体   English

台式机上不带egl的Opengl es 2.0(Windows)

[英]Opengl es 2.0 without egl on desktop (windows)

I have a simple program on windows using visual studios 2008. 我使用Visual Studio 2008在Windows上有一个简单的程序。

In my code i use gl functions ie #include GLES2/gl2.h and also #include EGL/egl.h 在我的代码中,我使用gl函数,即#include GLES2 / gl2.h和#include EGL / egl.h

In the code i use EGL for initialization for context. 在代码中,我使用EGL进行上下文初始化。 which is shown below. 如下所示。

It creates a window and CreateEGLContext. 它创建一个窗口和CreateEGLContext。

I am not displaying my result on the screen. 我没有在屏幕上显示结果。 but storing in memory so i am not swapping display and surface buffer. 但存储在内存中,所以我不交换显示和表面缓冲区。

My issues you i want to remove egl.h from this code how is it possible. 我的问题我想从此代码中删除egl.h,这怎么可能。

Can anyone give me any idea. 谁能给我任何想法。 Thank you in advance 先感谢您

GLboolean  CreateWindow1 ( ESContext *esContext, const char* title, GLint width, GLint height,      GLuint flags )
{
   GLuint attribList[] =
         {
      EGL_RED_SIZE,       5,
     EGL_GREEN_SIZE,     6,
   EGL_BLUE_SIZE,      5,
   EGL_ALPHA_SIZE,     (flags & ES_WINDOW_ALPHA) ? 8 : EGL_DONT_CARE,
   EGL_DEPTH_SIZE,     (flags & ES_WINDOW_DEPTH) ? 8 : EGL_DONT_CARE,
   EGL_STENCIL_SIZE,   (flags & ES_WINDOW_STENCIL) ? 8 : EGL_DONT_CARE,
   EGL_SAMPLE_BUFFERS, (flags & ES_WINDOW_MULTISAMPLE) ? 1 : 0,
   EGL_NONE
  };

   if ( esContext == NULL )
  {
     return GL_FALSE;
  }

  esContext->width = width;
  esContext->height = height;

  if ( !WinCreate ( esContext, title) )
    {
    return GL_FALSE;
    }


     if ( !CreateEGLContext ( esContext->hWnd,  &esContext->eglDisplay,  &esContext->eglContext,    &esContext->eglSurface,
                    attribList) )
  {
  return GL_FALSE;
  }


  return GL_TRUE;
 }

My answer is the solution i assume. 我的答案是我认为的解决方案。 or we can make our own framework if we want to or use any other framework :) 或者如果我们想要或使用任何其他框架,我们可以建立自己的框架:)

@Nicol Bolas: Thank you very much for your edits. @Nicol Bolas:非常感谢您的编辑。 I add OpenGL to my questions because someone doing OpenGL understand OpenGL ES as its a sub APL of OpenGL. 我将OpenGL添加到我的问题中,因为使用OpenGL的人将OpenGL ES理解为OpenGL的子APL。 I suggest you do better edits which would help. 我建议您进行更好的编辑,这将有所帮助。 I lost ability to post question before of your multiple edits 在您进行多次修改之前,我无法发布问题

EGL provides a “glue” layer between OpenGL ES 2.0 (and other Khronos graphics APIs) and the native windowing system running on your computer, like the X Window System common on GNU/Linux systems, Microsoft Windows, or Mac OS X's Quartz. EGL在OpenGL ES 2.0(和其他Khronos图形API)与计算机上运行的本机窗口系统(例如GNU / Linux系统,Microsoft Windows或Mac OS X的Quartz上常见的X窗口系统)之间提供了一个“胶合层”。 Before EGL can determine what types of drawing surfaces, or any other characteristics of the underlying system for that matter, it needs to open a communications channel with the windowing system. 在EGL能够确定哪种类型的绘图表面或与此相关的基础系统的任何其他特征之前,它需要打开与窗口系统的通信通道。 Because every windowing system has different semantics, EGL provides a basic opaque type—the EGLDisplay—that encapsulates all of the system dependencies for interfacing with the native windowing system. 因为每个窗口系统都有不同的语义,所以EGL提供了一种基本的不透明类型-EGLDisplay,该类型封装了所有系统相关性以与本机窗口系统进行接口连接。 The first operation that any application using EGL will need to do is create and initialize a connection with the local EGL display. 使用EGL的任何应用程序都需要做的第一个操作是创建并初始化与本地EGL显示的连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM