MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / initFromScreen

Method initFromScreen

src/resources/TextureResource.cpp:60–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void TextureResource::initFromScreen()
61{
62 deinit();
63
64 int width = Renderer::getScreenWidth();
65 int height = Renderer::getScreenHeight();
66
67 glGenTextures(1, &mTextureID);
68 glBindTexture(GL_TEXTURE_2D, mTextureID);
69
70 glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, width, height, 0);
71
72 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
73 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
74
75 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
76 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
77
78 mTextureSize[0] = height;
79 mTextureSize[1] = height;
80}
81
82void TextureResource::deinit()
83{

Callers 1

copyScreenMethod · 0.80

Calls 3

deinitFunction · 0.50
getScreenWidthFunction · 0.50
getScreenHeightFunction · 0.50

Tested by

no test coverage detected