MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / create

Method create

examples/ExampleBrowser/GwenGUISupport/GraphingTexture.cpp:26–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26bool GraphingTexture::create(int texWidth, int texHeight)
27{
28 m_width = texWidth;
29 m_height = texHeight;
30 glActiveTexture(GL_TEXTURE0);
31
32 m_imageData.resize(texWidth * texHeight * 4);
33 for (int y = 0; y < texHeight; ++y)
34 {
35 // const int t=y>>5;
36 GLubyte* pi = &m_imageData[y * texWidth * 4];
37 for (int x = 0; x < texWidth; ++x)
38 {
39 if (x >= y) //x<2||y<2||x>253||y>253)
40 {
41 pi[0] = 0;
42 pi[1] = 0;
43 pi[2] = 255;
44 pi[3] = 255;
45 }
46 else
47 {
48 pi[0] = 255;
49 pi[1] = 0;
50 pi[2] = 0;
51 pi[3] = 255;
52 }
53
54 pi += 4;
55 }
56 }
57
58 glGenTextures(1, (GLuint*)&m_textureId);
59
60 uploadImageData();
61 return true;
62}
63
64void GraphingTexture::uploadImageData()
65{

Callers 1

createCanvasMethod · 0.45

Calls 1

resizeMethod · 0.45

Tested by

no test coverage detected