mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-06 02:09:55 +03:00
Load entry points dynamically in tests and samples.
This CL adds a dynamic loader generator based on XML files. It also refactors the entry point generation script to move the XML parsing into a helper class. Additionally this includes a new GLES 1.0 base header. The new header allows for function pointer types and hiding prototypes. All tests and samples now load ANGLE dynamically. In the future this will be extended to load entry points from the driver directly when possible. This will allow us to perform more accurate A/B testing. The new build configuration leads to some tests having more warnings applied. The CL includes fixes for the new warnings. Bug: angleproject:2995 Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05 Reviewed-on: https://chromium-review.googlesource.com/c/1359516 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
@@ -9,16 +9,16 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
#include "OSWindow.h"
|
||||
#include "system_utils.h"
|
||||
#include "util/OSWindow.h"
|
||||
#include "util/system_utils.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
OSWindow *window = CreateOSWindow();
|
||||
int width = 400;
|
||||
int height = 400;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int width = 400;
|
||||
int height = 400;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
if (!window->initialize("Window Test", width, height))
|
||||
{
|
||||
@@ -41,66 +41,66 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (event.Type == Event::EVENT_KEY_PRESSED)
|
||||
{
|
||||
int newWidth = width;
|
||||
int newWidth = width;
|
||||
int newHeight = height;
|
||||
int newX = x;
|
||||
int newY = y;
|
||||
int newX = x;
|
||||
int newY = y;
|
||||
switch (event.Key.Code)
|
||||
{
|
||||
case KEY_ESCAPE:
|
||||
running = false;
|
||||
break;
|
||||
case KEY_ESCAPE:
|
||||
running = false;
|
||||
break;
|
||||
|
||||
case KEY_W:
|
||||
newWidth = std::max(0, width + (event.Key.Shift ? -20 : 20));
|
||||
break;
|
||||
case KEY_H:
|
||||
newHeight = std::max(0, height + (event.Key.Shift ? -20 : 20));
|
||||
break;
|
||||
case KEY_W:
|
||||
newWidth = std::max(0, width + (event.Key.Shift ? -20 : 20));
|
||||
break;
|
||||
case KEY_H:
|
||||
newHeight = std::max(0, height + (event.Key.Shift ? -20 : 20));
|
||||
break;
|
||||
|
||||
case KEY_LEFT:
|
||||
newX = x - 20;
|
||||
break;
|
||||
case KEY_RIGHT:
|
||||
newX = x + 20;
|
||||
break;
|
||||
case KEY_UP:
|
||||
newY = y - 20;
|
||||
break;
|
||||
case KEY_DOWN:
|
||||
newY = y + 20;
|
||||
break;
|
||||
case KEY_LEFT:
|
||||
newX = x - 20;
|
||||
break;
|
||||
case KEY_RIGHT:
|
||||
newX = x + 20;
|
||||
break;
|
||||
case KEY_UP:
|
||||
newY = y - 20;
|
||||
break;
|
||||
case KEY_DOWN:
|
||||
newY = y + 20;
|
||||
break;
|
||||
|
||||
case KEY_C:
|
||||
window->setMousePosition(width / 2, height / 2);
|
||||
break;
|
||||
case KEY_T:
|
||||
window->signalTestEvent();
|
||||
window->messageLoop();
|
||||
if (window->didTestEventFire())
|
||||
{
|
||||
std::cout << "Test event did fire" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Test event did not fire" << std::endl;
|
||||
}
|
||||
break;
|
||||
case KEY_S:
|
||||
window->setVisible(false);
|
||||
window->messageLoop();
|
||||
angle::Sleep(1000);
|
||||
window->setVisible(true);
|
||||
window->messageLoop();
|
||||
break;
|
||||
case KEY_C:
|
||||
window->setMousePosition(width / 2, height / 2);
|
||||
break;
|
||||
case KEY_T:
|
||||
window->signalTestEvent();
|
||||
window->messageLoop();
|
||||
if (window->didTestEventFire())
|
||||
{
|
||||
std::cout << "Test event did fire" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Test event did not fire" << std::endl;
|
||||
}
|
||||
break;
|
||||
case KEY_S:
|
||||
window->setVisible(false);
|
||||
window->messageLoop();
|
||||
angle::Sleep(1000);
|
||||
window->setVisible(true);
|
||||
window->messageLoop();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (newWidth != width || newHeight != height)
|
||||
{
|
||||
width = newWidth;
|
||||
width = newWidth;
|
||||
height = newHeight;
|
||||
window->resize(width, height);
|
||||
}
|
||||
@@ -115,13 +115,16 @@ int main(int argc, char *argv[])
|
||||
window->messageLoop();
|
||||
if (window->getWidth() != width || window->getHeight() != height)
|
||||
{
|
||||
std::cout << "Discrepancy between set dimensions and retrieved dimensions" << std::endl;
|
||||
std::cout << "Discrepancy between set dimensions and retrieved dimensions"
|
||||
<< std::endl;
|
||||
std::cout << "Width: " << width << " vs. " << window->getWidth() << std::endl;
|
||||
std::cout << "Height: " << height << " vs. " << window->getHeight() << std::endl;
|
||||
std::cout << "Height: " << height << " vs. " << window->getHeight()
|
||||
<< std::endl;
|
||||
}
|
||||
if (window->getX() != x || window->getY() != y)
|
||||
{
|
||||
std::cout << "Discrepancy between set position and retrieved position" << std::endl;
|
||||
std::cout << "Discrepancy between set position and retrieved position"
|
||||
<< std::endl;
|
||||
std::cout << "X: " << x << " vs. " << window->getX() << std::endl;
|
||||
std::cout << "Y: " << y << " vs. " << window->getY() << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user