Slight cleanup
This commit is contained in:
parent
ba3d25181e
commit
bd4ab30b42
15
src/core.c
15
src/core.c
|
|
@ -2994,24 +2994,23 @@ static bool InitGraphicsDevice(int width, int height)
|
||||||
// save the first mode
|
// save the first mode
|
||||||
// TODO: Take a better resolution.
|
// TODO: Take a better resolution.
|
||||||
CORE.Window.mode_info = connector->modes[0];
|
CORE.Window.mode_info = connector->modes[0];
|
||||||
printf ("resolution: %ix%i\n", CORE.Window.mode_info.hdisplay, CORE.Window.mode_info.vdisplay);
|
|
||||||
|
|
||||||
// find an encoder
|
// find an encoder
|
||||||
drmModeEncoder *encoder;
|
drmModeEncoder *encoder;
|
||||||
if (connector->encoder_id) {
|
|
||||||
encoder = drmModeGetEncoder (fd, connector->encoder_id);
|
if (connector->encoder_id)
|
||||||
}
|
encoder = drmModeGetEncoder(fd, connector->encoder_id);
|
||||||
|
|
||||||
if (!encoder)
|
if (!encoder)
|
||||||
TRACELOG(LOG_ERROR, "DISPLAY: No DRM encoder found.");
|
TRACELOG(LOG_ERROR, "DISPLAY: No DRM encoder found.");
|
||||||
|
|
||||||
// find a CRTC
|
// find a CRTC
|
||||||
if (encoder->crtc_id)
|
if (encoder->crtc_id)
|
||||||
CORE.Window.crtc = drmModeGetCrtc (fd, encoder->crtc_id);
|
CORE.Window.crtc = drmModeGetCrtc(fd, encoder->crtc_id);
|
||||||
|
|
||||||
drmModeFreeEncoder (encoder);
|
drmModeFreeEncoder(encoder);
|
||||||
drmModeFreeConnector (connector);
|
drmModeFreeConnector(connector);
|
||||||
drmModeFreeResources (resources);
|
drmModeFreeResources(resources);
|
||||||
|
|
||||||
struct gbm_device *gbmDevice = gbm_create_device(fd);
|
struct gbm_device *gbmDevice = gbm_create_device(fd);
|
||||||
if (!gbmDevice)
|
if (!gbmDevice)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user