예제 #1
0
파일: fbwrap.c 프로젝트: emvirt/alps_root
int call_fbGetDisplayGeometry(int *pDatabuf)
{
	str_fbGetDisplayGeometry *function;
	int width, height;
	int ret;
	
	function = (str_fbGetDisplayGeometry *)pDatabuf;

	fbGetDisplayGeometry(function->Display, &width, &height);

	// For normal window
	if(width > 1920)
		width = 1920;
	if(height > 360)
		height = 360;

	function->Width = width;
	function->Height = height;

	if(function->hd.retFlag == RT_REQUEST){
		function->hd.retFlag = RT_RESPONSE;
		ret = write(dev, function, MAX_BUF_SIZE);
	}

	return 0;
}
예제 #2
0
native_gfx_t *
native_gfx_open_display(void)
{
  native_gfx_t *gfx;

  gfx = malloc(sizeof (*gfx));
  if (gfx == NULL) {
    fprintf(stderr,
            "native_gfx_open_display(): Can't allocate memory: error %i: %s\n",
            errno, strerror(errno));
    exit(EXIT_FAILURE);
  }

  memset(gfx, 0, sizeof (*gfx));

  gfx->disp = fbGetDisplay(NULL);

  if (gfx->disp == NULL) {
    fprintf(stderr, "ERROR: native_gfx_open_display(): "
            "fbGetDisplay() returned NULL\n");
    exit(EXIT_FAILURE);
  }

  fbGetDisplayGeometry(gfx->disp,
                       &gfx->disp_width,
                       &gfx->disp_height);

  return (gfx);
}
예제 #3
0
파일: Egl.cpp 프로젝트: ValXp/particles
void	initEglOnly()
{
  const EGLint config_attr[] =
    {
      EGL_RED_SIZE,	5,
      EGL_GREEN_SIZE, 	6,
      EGL_BLUE_SIZE,	5,
      EGL_ALPHA_SIZE, 	EGL_DONT_CARE,
      EGL_NONE
    };
 
  EGLint configs, major, minor;

  EGLNativeDisplayType native_disp = fbGetDisplayByIndex(0);                              /* i.MX6 specific */
  fbGetDisplayGeometry(native_disp, &m_width, &m_height);                                 /* i.MX6 specific */
  EGLNativeWindowType native_win  = fbCreateWindow(native_disp, 0, 0, m_width, m_height); /* i.MX6 specific */
  
  eglBindAPI(EGL_OPENGL_ES_API);

  m_egldisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
  eglInitialize(m_egldisplay, &major, &minor);
  
  eglGetConfigs(m_egldisplay, NULL, 0, &configs);
  
  eglChooseConfig(m_egldisplay, config_attr, &m_eglconfig, 1, &configs);
  m_eglsurface = eglCreateWindowSurface(m_egldisplay, m_eglconfig, native_win, NULL);
}
예제 #4
0
QEglFSImx6Hooks::QEglFSImx6Hooks()
{
    int width, height;
    mNativeDisplay = fbGetDisplayByIndex(0);
    fbGetDisplayGeometry(mNativeDisplay, &width, &height);
    mScreenSize.setHeight(height);
    mScreenSize.setWidth(width);
}
예제 #5
0
//! create the driver
void CIrrDeviceFB::createDriver()
{
	switch(CreationParams.DriverType)
	{
	case video::EDT_SOFTWARE:
		#ifdef _IRR_COMPILE_WITH_SOFTWARE_
		VideoDriver = video::createSoftwareDriver(CreationParams.WindowSize, CreationParams.Fullscreen, FileSystem, this);
		#else
		os::Printer::log("No Software driver support compiled in.", ELL_WARNING);
		#endif
		break;

	case video::EDT_BURNINGSVIDEO:
		#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
		VideoDriver = video::createBurningVideoDriver(CreationParams, FileSystem, this);
		#else
		os::Printer::log("Burning's video driver was not compiled in.", ELL_WARNING);
		#endif
		break;

	case video::EDT_OGLES2:
		#ifdef _IRR_COMPILE_WITH_OGLES2_
		{
			video::SExposedVideoData data;
			s32 width = 0;
			s32 height = 0;
			NativeDisplayType display = fbGetDisplay(0);
			fbGetDisplayGeometry(display, &width, &height);
			data.OpenGLFB.Window = (void*)fbCreateWindow(display, 0, 0, width, height);
			ContextManager = new video::CEGLManager();
			ContextManager->initialize(CreationParams, data);
			VideoDriver = video::createOGLES2Driver(CreationParams, FileSystem, ContextManager);
		}
		#else
		os::Printer::log("No OpenGL-ES2 support compiled in.", ELL_ERROR);
		#endif
		break;

	case video::EDT_OGLES1:
	case video::EDT_OPENGL:
	case video::EDT_DIRECT3D8:
	case video::EDT_DIRECT3D9:
		os::Printer::log("This driver is not available in FB. Try Software renderer.",
			ELL_WARNING);
		break;

	default:
		VideoDriver = video::createNullDriver(FileSystem, CreationParams.WindowSize);
		break;
	}
}
예제 #6
0
QEglFSImx6Hooks::QEglFSImx6Hooks()
{
    int width, height;

    bool multiBufferNotEnabledYet = qEnvironmentVariableIsEmpty("FB_MULTI_BUFFER");
    bool multiBuffer = qEnvironmentVariableIsEmpty("QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER");
    if (multiBufferNotEnabledYet && multiBuffer) {
        qWarning() << "QEglFSImx6Hooks will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.\n"
                   << "If this is not desired, you can override this via: export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1";
        qputenv("FB_MULTI_BUFFER", "2");
    }

    mNativeDisplay = fbGetDisplayByIndex(framebufferIndex());
    fbGetDisplayGeometry(mNativeDisplay, &width, &height);
    mScreenSize.setHeight(height);
    mScreenSize.setWidth(width);
}
예제 #7
0
EGLNativeDisplayType _glusOsGetNativeDisplayType()
{
	if (g_nativeDisplay != 0)
	{
		return g_nativeDisplay;
	}

	g_nativeDisplay = fbGetDisplayByIndex(0);

	if (g_nativeDisplay == 0)
	{
		glusLogPrint(GLUS_LOG_ERROR, "Could not get native display");

		return 0;
	}

	fbGetDisplayGeometry(g_nativeDisplay, &g_displayWidth, &g_displayHeight);

	return g_nativeDisplay;
}