Added test texture and testing vitasdk caching (2)

This commit is contained in:
2023-03-20 22:59:32 -07:00
parent 9fa994b850
commit fe5293e5bd
2 changed files with 14 additions and 4 deletions

View File

@ -19,12 +19,22 @@ namespace Dawn {
UILabel *label;
UIImage *image;
BitmapFont font;
Texture test;
void stage() override {
camera = Camera::create(this);
camera->transform->lookAt(glm::vec3(3, 3, 3), glm::vec3(0, 0, 0));
cube = SimpleSpinningCubePrefab::create(this);
cube->material->texture = &test;
struct Color colors[] = {
COLOR_RED, COLOR_BLUE, COLOR_GREEN,
COLOR_MAGENTA, COLOR_DARK_GREY, COLOR_WHITE,
COLOR_BLACK, COLOR_CORNFLOWER_BLUE, COLOR_RED
};
test.setSize(3, 3);
test.buffer(colors);
canvas = UICanvas::create(this);

View File

@ -36,10 +36,10 @@ void Texture::setSize(int32_t width, int32_t height) {
// Setup our preferred texture params, later this will be configurable.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Initialize the texture to blank
glTexImage2D(