Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Timetablex/timetableLoading.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
65 lines (45 sloc)
1.39 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <SFML/Graphics.hpp> | |
//#include <SFML/Main.hpp> | |
//#include <winsqlite/winsqlite3.h> | |
using namespace sf; | |
// function timetable takes and uses the username parameter | |
// to get the courseId of each user which is the | |
// name of the timetable for each course | |
string timetable(string username) | |
{ | |
//sqlite3* db; | |
//sqlite3_open("Timetablex.db", &db); | |
//string timetableName = db("SELECT courseId WHERE (AccountName = " + username +";"); | |
//sqlite3_close(); | |
string timetableName = "1"; | |
return timetableName; | |
}; | |
// function timetableLoading takes the username parameter | |
// and uses it in the name of the new window | |
// | |
// in the new window the timetable is rendered | |
// | |
// SFML library used to display the timetable | |
int timetableLoading(string username) | |
{ | |
RenderWindow window(VideoMode(1270, 530), username + "'s Timetable"); | |
string timetableName = timetable(username) + ".png"; | |
Texture timetableTexture; | |
timetableTexture.loadFromFile(timetableName); | |
Sprite timetableSprite; | |
timetableSprite.setTexture(timetableTexture); | |
while (window.isOpen()) | |
{ | |
Event event; | |
while (window.pollEvent(event)) | |
{ | |
if (event.type == Event::Closed) | |
window.close(); | |
} | |
window.clear(); | |
window.draw(timetableSprite); | |
window.display(); | |
} | |
return 0; | |
}; |