summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2013-07-01api, android: Add window resize call and implementation for AndroidJuha-Pekka Heikkila1-0/+6
Added waffle_window_resize(self, width, heigh) API call. Currently implemented only on Android, other platforms return WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM. Signed-off-by: Juha-Pekka Heikkila <juha-pekka.heikkila@linux.intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-15include: #define restrict for C language < c99Chad Versace1-0/+4
Fixes build breakage on Piglit, which uses -std=c90 on Linux. The 'restrict' keyword was introduced in C99. The #definition of restrict was present in the now deleted header waffle_portability.h. I forgot to move the #definition during the header shuffle. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-15include: Fold nearly all headers into waffle.hChad Versace13-730/+308
Fold all headers into waffle.h except - The native platform headers, because users need to be able to select which to include and exclude. - waffle_version.h, which is generate at configure time. When Waffle's documentation consisted of Doxygen in the headers, it was sensible to maintain a separate header for each class of functions. The Doxygen was lengthy, thus having separate headers made the documentation easier to navigate. Now that the documentation resides in manpage xml, each individual header is nearly empty. It's silly to have numerous headers that declare only 3 to 4 functions each. Strictly speaking, removing header files breaks the API. But I'm aware of no client that will miss the removed headers. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12include: Add enums for OpenGL ES3Chad Versace1-0/+2
Add enums WAFFLE_CONTEXT_OPENGL_ES3 and WAFFLE_DL_OPENGL_ES3. Waffle does not yet accept the new enums. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-02Revert "waffle: Support OpenGL ES3"Chad Versace1-1/+0
This reverts commit 52df64af6a57d7fabc87afc4685588a2875a83d0. After more closely reading the EGL_KHR_create_context spec and discussing its history with Iam Romanick <idr@freedesktop.org>, I decided that Waffle's interface for creating an OpenGL ES3 context needs changing. I wish to model it after how GLES3 contexts are created in Khronos' OpenGL ES3 conformance testsuite. Discussion of EGL_OPENGL_ES3_BIT_KHR ------------------------------------ In version 13 of the EGL_KHR_create_context spec, the only way to explicitly request a GLES3 context was to (1) choose an EGLConfig whose EGL_RENDERABLE_TYPE attribute had the EGL_OPENGL_ES2_BIT set and (2) then call eglCreateContext with EGL_CONTEXT_MAJOR_VERSION_KHR = 3. In version 14 was added a new enum, EGL_OPENGL_ES2_BIT_KHR, and thus a second way to explicitly request a GLES3 context. From a close reading of the EGL_KHR_create_context spec and from a discussion with Romanick, I discovered that the EGL working group's preferred method for creating a GLES3 context is that from version 13. This observation is corroborated by Khronos' OpenGL ES3 conformance testsuite, which does not use EGL_OPENGL_ES3_BIT_KHR. Change in Waffle's interface ---------------------------- The original interface, as added by the reverted patch, for creating a GLES3 context looks like this: int32_ attrib_list = { WAFFLE_CONTEXT_API, WAFFLE_CONTEXT_OPENGL_ES3, 0, }; config = waffle_config_choose(dpy, attrib_list); ctx = waffle_context_create(config, NULL); Instead, I wish to change it to follow the original intent of the EGL_KHR_create_context spec and the precedent in Khronos' OpenGL ES3 conformance testsuite: int32_ attrib_list = { WAFFLE_CONTEXT_API, WAFFLE_CONTEXT_OPENGL_ES2, WAFFLE_CONTEXT_MAJOR_VERSION, 3, 0, }; config = waffle_config_choose(dpy, attrib_list); ctx = waffle_context_create(config, NULL); Issues ------ In reimplementing Waffle's OpenGL ES3 support, I will be careful to accomodate EGL implementations that require EGL_OPENGL_ES3_BIT_KHR to be set. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01cmake: Remove commented-out codeChad Versace1-3/+0
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-29waffle: Support OpenGL ES3Chad Versace1-0/+1
- Add enum WAFFLE_CONTEXT_OPENGL_ES3. - Extend wcore_config_attrs_parse() for ES3. - GLX, CGL: - Reject ES3 from display_supports_api(). - Reject ES3 configs and contexts. - EGL: - Extend display_supports_api() for ES3. - Extend config and context creation for ES3. Note: I have access to no driver that supports OpenGL ES3. Once Mesa's Intel driver acquires ES3 support, I will test this patch against it. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-15include: Remove doxygen from public headersChad Versace11-435/+0
The recently added man pages were based on this doxygen and are now the canonical source of user documentation. Delete the doxygen so it doesn't drift out-of-sync with with the man pages. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-12include: Add WAFFLE_ERROR_BUILT_WITHOUT_SUPPORTChad Versace1-0/+3
This error indicates that waffle was built without support for the requested action. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-12cmake: Use the GNUInstallDirs moduleChad Versace1-1/+1
This adds CMake options that are familiar to autoconf users, such as CMAKE_INSTALL_LIBDIR. Portage's cmake.eclass expects these variables to be supported. This replaces the following CMake options. If the user specifies any of the old options, then emit a fatal error. waffle_install_includedir -> CMAKE_INSTALL_INCLUDEDIR waffle_install_libdir -> CMAKE_INSTALL_LIBDIR waffle_install_docdir -> CMAKE_INSTALL_DOCDIR Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-04gbm: initial skeleton for gbm supportJordan Justen6-0/+74
All routines in this skeleton will fail. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-04waffle: add GBM platform enumeration valueBen Widawsky1-0/+1
Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-28include: Fix #include's in waffle_glx.hChad Versace1-1/+1
waffle_glx.h included <X11/Xlib.h> but not <GL/glx.h>. This patch replaces the former with the latter, since the latter includes the former. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-23include: Add header waffle_version.hChad Versace4-0/+16
This header defines WAFFLE_{MAJOR,MINOR,PATCH}_VERSION in order to allow users to determine the version at configuration and compile time. This also allows CMake to detect the Waffle's version on systems that don't have pkgconfig, namely Windows. Note: This prepares for the 1.0 release. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-23include, pkgconfig: Change install directory for headersChad Versace1-1/+1
Install headers into include/waffle-MAJOR/. This will allow multiple major versions of Waffle to be installed in parallel. Note: This prepares for the 1.0 release. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-23install: Fix installation of native headersChad Versace1-0/+3
They were not getting installed at all. Oops. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-23include: Move native headers to toplevelChad Versace3-0/+0
Move headers in include/waffle/native/ to include/waffle/. Note: This prepares for the 1.0 release. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-19include: Fix doc for waffle_init()Chad Versace1-1/+1
Fix list of valid platform enums. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-19include: Document some functionsChad Versace2-0/+3
Document waffle_make_current and waffle_get_proc_address. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-19include: Rename error to WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORMChad Versace1-1/+1
The new name is more clearly conveys the error meaning than the old name, WAFFLE_ERROR_UNSUPPORTED. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-19include: Cleanup waffle_error doxygenChad Versace1-5/+2
- Remove redundant comments in waffle_error_get_code(). - Remove references to non-existent function, waffle_finish(). Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-19include: Remove fwd decls of undefined native typesChad Versace4-16/+0
Remove the forward declarations of the native types for the CGL and Android platforms. The types were nowhere defined. If in the future the waffle_*_get_native functions become implemented for these platforms, then we can easily revert this commit. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07include: Fix doxygen for waffle_initChad Versace1-3/+3
The error enums were renamed in 8e5431e. This patch fixes the following names in the doxygen for waffle_init(): WAFFLE_ALREADY_INITIALIZED -> WAFFLE_ERROR_ALREADY_INITIALIZED WAFFLE_BAD_ATTRIBUTE -> WAFFLE_ERROR_BAD_ATTRIBUTE Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-10include: Improve docs for enum waffle_errorChad Versace1-20/+29
Describe the actions and conditions that produce each error. Remove some stale documentation. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-10include: Rename error enumsChad Versace1-10/+10
For consistency, rename each token in `enum waffle_error` with the prefix WAFFLE_ERROR. The exception is WAFFLE_NO_ERROR, which is not renamed. This changes follows the precedent of Wayland, and makes it much easier to grep for error cases. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-10include: Remove unused error enumsChad Versace1-4/+0
Remove WAFFLE_NOT_IMPLEMENTED. That error shouldn't be part of a public API. Remove WAFFLE_INCOMPATIBLE_ATTRIBUTES. This was never used. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-05include: Add headers <waffle/native/*.h>Chad Versace3-0/+192
Add the following headers: waffle_glx.h waffle_wayland.h waffle_x11_egl.h Each header defines the types returned by waffle_$x_get_native for the respective platform. The types defined are: struct waffle_$x_config struct waffle_$x_context struct waffle_$x_display struct waffle_$x_window This patch intentionally neglects waffle_cgl.h because I haven't yet decided how to define the waffle_cgl types. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-05include: Declare functions waffle_$x_get_native()Chad Versace4-0/+80
The following functions are declared: waffle_config_get_native() waffle_context_get_native() waffle_display_get_native() waffle_window_get_native() These functions allow users to get the underlying native objects. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-05include: Rename waffle_portable.h -> waffle_portability.hChad Versace13-13/+13
The original filename was dumb. The new filename makes more sense. As a precedent, I have seen other projects that contain a header named *_portability.h Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-05include: Document that destroying a display invalidates other objectsChad Versace1-0/+4
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-03all: Replace tagged unions with a more traditional object modelChad Versace1-7/+0
This rewrites the bulk of Waffle's code. When I first began writing Waffle, I wanted to experiment with a non-traditional object model that used tagged unions. Very soon I began to abhor the "innovative" decision. This patch replaces the tagged-union model with a more traditional object model (as found in the Linux kernel [1], Google's NaCl, libdrm, and many other places) that uses vtables and embedded structures. [1] Neil Brown. LWN, 2011 June 1. Object-oriented design patterns in the kernel. (Part 1: http://lwn.net/Articles/444910/). (Part 2: http://lwn.net/Articles/446317/). As an example of the new object model, below is an outline of how waffle_window_swap_buffers() is now implemeneted. // file: waffle_window.c bool waffle_window_swap_buffers(struct waffle_window *self) { struct wcore_window *wc_self = wcore_window(self); // safe cast // Check preconditions ... return wc_self->vtbl->swap_buffers(wc_self); } // file: wcore_window.h struct wcore_window_vtbl { bool (*swap_buffers)(struct wcore_window *self); // More member functions ... }; struct wcore_window { const struct wcore_window_vtbl *vtbl; struct waffle_window {} wfl; // More members ... }; // file: glx_window.h struct glx_window { struct wcore_window wcore; // More members ... }; // file: glx_window.c static bool glx_window_swap_buffers(struct wcore_window *wc_self) { struct glx_window *self = glx_window(wc_self); // safe cast // Call glXSwapBuffers ... return true; } static const struct wcore_window_vtbl glx_window_wcore_vtbl = { .swap_buffers = glx_window_swap_buffers, // More members ... }; Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-01include: Remove error WAFFLE_OLD_OBJECTChad Versace1-1/+0
Now that waffle_finish() is no longer in Waffle's API, it is impossible to produce this error. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-30license: Convert from Apache 2.0 to BSDChad Versace12-108/+240
Jordan Justen brought to my attention that, according to the Apache and GNU websites, Apache 2.0 is incompatible with GPLv2 because GPLv2 lacks a patent indemnification clause. (It is compatible with GPLv3, however). See [1] [2] [3]. By the same logic, a lawyer could argue that Apache 2.0 is also incompatible, in one direction only, with minimal gift licenses such as BSD and MIT. I do not want license incompatibility to prevent any project from using Waffle's code, so I'm converting the project to use the most liberal license possible, BSD 2-clause [4]. [1] http://www.apache.org/licenses/GPL-compatibility.html [2] http://www.gnu.org/licenses/license-list.html#apache2 [3] http://en.wikipedia.org/wiki/Apache_License#GPL_compatibility [4] http://www.opensource.org/licenses/bsd-license.php CC: Jordan Justen <jljusten@gmail.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-30include: Rename WAFFLE_PLATFORM_COCOA to WAFFLE_PLATFORM_CGLChad Versace2-2/+2
Cocoa is a general-purpose Objective-C framework, not Apple's GL interface. The GL interface is named CGL. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23include,api: Add waffle_get_platform()Chad Versace1-0/+7
This returns the WAFFLE_PLATFORM_* that was given to waffle_init(). Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23include,core: Let waffle_error_get_info() return a structChad Versace1-29/+32
Using waffle_error_get_info() was awkward. It had three return parameters. To use it, the user had to declare three temporary variables into which the info was returned. This patch changes the function to return a struct that contains all the info formerly returned in the output parameters. This allows usage like: printf("ouch! %s\n", waffle_error_get_info()->message); Some documentation in waffle_error.h is fixed up and relocated, as appropriate with this change. Several tests are fixed in tandem with this change. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23all: Add enum WAFFLE_ACCUM_BUFFERChad Versace2-0/+3
This is a boolean attribute for waffle_config. If true on EGL, the WAFFLE_UNSUPPORTED_ON_PLATFORM on is emitted. If true on GLX, then an accum buffer is requested. This is required for Piglit test 'clear-accum'. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23include: Fix headers for C versions < C99Chad Versace1-0/+4
The 'restrict' keyword was introduced in C99. If the C version is less, then remove occurences the keyword with a macro. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23include: Remove macro WAFFLE_APIENTRYChad Versace1-5/+0
This Microsoft-only macro was never used. If needed, it can be added back when Windows support arrives. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23include: Rename waffle_visibility.h -> waffle_portable.hChad Versace13-14/+16
The intent is that this header contain all macro cruft for cross-platform portability. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23include,api: Add waffle_window_show()Chad Versace1-0/+8
Declare waffle_window_show() in waffle_window.h and implement the api entry point. If platform does yet implement this function, then waffle_window_show() succeeds without warning. Update doxygen for waffle_window to reflect the new, expected behavior--- waffle_window_create() will not display the window if the platform allows it. One must call waffle_window_show(). Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-17include: Kill waffle_finish()Chad Versace1-22/+3
I originally had high hopes for this function, but it failed to work as expected, but by no fault of Waffle. I had wanted to be able to initialize Waffle multiple times in one process, each time with a different platform: GLX, Wayland, then X11/EGL. However, Mesa's libEGL can only be initialized once per process. Waffle shouldn't pretend to the user that it can do the impossible, so just remove waffle_finish() and all documentation that referes to it and re-initialization. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-17include: Remove refs to WAFFLE_OPENGL_API in waffle_init doxygenChad Versace1-29/+1
The enum no longer exists. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-17include: Remove WAFFLE_OPENGL* attributesChad Versace1-5/+0
These attributes are no longer used. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-17include: Add function waffle_is_extension_in_stringChad Versace1-0/+13
This can be used to find GL/GLX/EGL extensions in a GL-style extension string. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-17include,native: Add function waffle_display_supports_context_apiChad Versace1-0/+8
This patch implements the function at the API level and adds an entry into the native dispatch table. No platform yet implements native_dispatch.display_supports_context_api, so the new function currently segfaults. Future patches will implement the dispatch entry for each platform. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-17include: Reorg doxygen for waffle_config_chooseChad Versace1-32/+27
Users want to see a quick example before diving into the documentation's details, so move the example from the bottom to the top. Also, remove @return and @param. These were redundant and out of place. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-17include: Align enum values in waffle_enum.hChad Versace1-32/+32
WAFFLE_CONTEXT_COMPATIBILITY_PROFILE is such a long name that its enum value was pushed out to the right. To prettify the source, right-align all ='s to column 64. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-17include: Add new enums WAFFLE_CONTEXT_* and documentChad Versace2-15/+145
This patch mostly consists of documentation in waffle_config.h for the new enums. The new enums are not yet used. Some refactoring is needed before that is possible. The new context attributes are associated with waffle_config_choose rather than waffle_context_create because, on Apple, the context profile attributes must be given to CGLChoosePixelFormat. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-17all: Add function waffle_dl_can_openChad Versace1-0/+4
This function tests if a dynamic library can be opened. This patch implements it for all native platforms. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>