-
Notifications
You must be signed in to change notification settings - Fork 0
/
RegTextureMapped.cpp
40 lines (35 loc) · 1.1 KB
/
RegTextureMapped.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stdio.h>
#include <iostream>
#include <string>
#include "skilLib.h"
RegTextureMapped::RegTextureMapped(std::string gName, std::string gFull){
tex = getRegistry()->getTexture(gFull);
name = gName;
source = gFull;
float tmpx[4] = {0.0, 1.0, 1.0, 0.0};
float tmpy[4] = {0.0, 0.0, 1.0, 1.0};
for(int z = 0; z < 4; z++){
x[z] = tmpx[z];
y[z] = tmpy[z];
}
}
RegTextureMapped::RegTextureMapped(std::string gName, std::string gFull, float *gx, float *gy){
tex = getRegistry()->getTexture(gFull);
name = gName.c_str();
source = gFull.c_str();
for(int z = 0; z<4; z++){
x[z] = gx[z];
y[z] = gy[z];
}
}
GLuint RegTextureMapped::getTex(){
return tex->texture;
}
void RegTextureMapped::consoleDump(){
std::cout<<"Mapped Texture. Name: " << name << " Address: " <<this<< " Source: " << source << "\n";
std::cout<<"Points: (" << x[0] <<", "<<y[0]<<")("<< x[1] <<", "<<y[1]<<")("<< x[2] <<", "<<y[2]<<")("<< x[3] <<", "<<y[3]<<")\n";
std::cout<<"===================================================\n";
}
void RegTextureMapped::rePoint(){
tex = getRegistry()->getTexture(source);
}