forked from waffle-gl/waffle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wflinfo: show platform-specific information
Add waffle_display_print_info() which calls a new display struct member function "print_info" to print platform-specific information, such as glx or egl version and extensions. Call this new function from wflinfo when the -s flag is given. Gbm, glx and x11_egl platforms supported so far.
- Loading branch information
1 parent
a074cab
commit d0b45bb
Showing
13 changed files
with
106 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include "wcore_error.h" | ||
|
@@ -141,6 +142,37 @@ glx_display_supports_context_api(struct wcore_display *wc_self, | |
} | ||
} | ||
|
||
bool | ||
glx_display_print_info(struct wcore_display *wc_self, | ||
bool verbose) | ||
{ | ||
struct glx_display *self = glx_display(wc_self); | ||
struct glx_platform *plat = glx_platform(wc_self->platform); | ||
|
||
int major, minor; | ||
if (!plat->glXQueryVersion(self->x11.xlib, &major, &minor)) { | ||
return false; | ||
} | ||
|
||
printf("server glx vendor string: %s\n", | ||
plat->glXQueryServerString(self->x11.xlib, self->x11.screen, GLX_VENDOR)); | ||
This comment has been minimized.
Sorry, something went wrong.
versalinyaa
|
||
printf("server glx version string: %s\n", | ||
plat->glXQueryServerString(self->x11.xlib, self->x11.screen, GLX_VERSION)); | ||
printf("server glx extensions: %s\n", | ||
plat->glXQueryServerString(self->x11.xlib, self->x11.screen, GLX_EXTENSIONS)); | ||
printf("client glx vendor string: %s\n", | ||
plat->glXGetClientString(self->x11.xlib, GLX_VENDOR)); | ||
printf("client glx version string: %s\n", | ||
plat->glXGetClientString(self->x11.xlib, GLX_VERSION)); | ||
printf("client glx extensions: %s\n", | ||
plat->glXGetClientString(self->x11.xlib, GLX_EXTENSIONS)); | ||
printf("GLX version: %d.%d\n", major, minor); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
printf("GLX extensions: %s\n", | ||
plat->glXQueryExtensionsString(self->x11.xlib, self->x11.screen)); | ||
|
||
return true; | ||
} | ||
|
||
union waffle_native_display* | ||
glx_display_get_native(struct wcore_display *wc_self) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When adding new entries to the public API, the entry should be guarded with a feature test macro, just like the POSIX and Xopen macros. See man:waffle_feature_test_macros(7).
The sensible choice is to guard this with WAFFLE_API_VERSION >= 0x0106, just like waffle_window_create2().