| 904 | } |
| 905 | |
| 906 | int window::loadVideo(const char* filename, int x, int y, int w, int h){ |
| 907 | //determine if file exists |
| 908 | ifstream file(filename); |
| 909 | if (!file.good()){ |
| 910 | cout << filename << " video file not found" << endl; |
| 911 | return -1; |
| 912 | } |
| 913 | rectangle rect = createRectangle(x, y, w, h); |
| 914 | |
| 915 | //create verticies |
| 916 | float alpha = 1.0f; |
| 917 | Vertex verticiesSquare[] = { |
| 918 | {{rect.x, rect.y}, {0.0f, 0.0f, alpha}}, |
| 919 | {{rect.x2, rect.y}, {1.0f, 0.0f, alpha}}, |
| 920 | {{rect.x, rect.y2}, {0.0f, 1.0f, alpha}}, |
| 921 | {{rect.x2, rect.y2}, {1.0f, 1.0f, alpha}} |
| 922 | }; |
| 923 | |
| 924 | videoVerticies = vaoTextureCreate(verticiesSquare, sizeof(verticiesSquare)); |
| 925 | if(!videoVerticies){ |
| 926 | return -1; |
| 927 | } |
| 928 | |
| 929 | //glGenTextures(1, &videoTexture); |
| 930 | videoFilename = strdup(filename); |
| 931 | videoReady = true; |
| 932 | fCount = 0; |
| 933 | //cout << "Video Ready" << endl; |
| 934 | return 0; |
| 935 | } |
| 936 | |
| 937 | void window::playVideo(){ |
| 938 | beginVideoRender: |
nothing calls this directly
no test coverage detected