Click here to Skip to main content
15,881,882 members
Home / Discussions / Graphics
   

Graphics

 
QuestionGraphics for Visual Studio 2008 C++ Pin
The-Irishman14-Nov-23 11:06
The-Irishman14-Nov-23 11:06 
QuestionShadow copy with windows service Pin
Member 1611802317-Oct-23 22:46
Member 1611802317-Oct-23 22:46 
AnswerRe: How to send a windows message from C# to C++ Pin
Victor Nijegorodov5-Jun-23 20:32
Victor Nijegorodov5-Jun-23 20:32 
AnswerRe: How to send a windows message from C# to C++ Pin
jschell6-Jun-23 4:44
jschell6-Jun-23 4:44 
Questionwhat are the differences between pass-by-value and pass-by-reference in C++ Pin
ortegacarey31-May-23 20:30
ortegacarey31-May-23 20:30 
AnswerRe: what are the differences between pass-by-value and pass-by-reference in C++ Pin
Victor Nijegorodov31-May-23 20:47
Victor Nijegorodov31-May-23 20:47 
GeneralRe: what are the differences between pass-by-value and pass-by-reference in C++ Pin
trønderen1-Jun-23 14:45
trønderen1-Jun-23 14:45 
GeneralRe: what are the differences between pass-by-value and pass-by-reference in C++ Pin
Gerry Schmitz1-Jun-23 16:04
mveGerry Schmitz1-Jun-23 16:04 
Answertack snap shot with windows service Pin
sa1114419-Oct-21 23:02
sa1114419-Oct-21 23:02 
GeneralRe: tack snap shot with windows service Pin
OriginalGriff19-Oct-21 23:05
mveOriginalGriff19-Oct-21 23:05 
QuestionUWP Flyout Problem Pin
RWey22-Jun-21 10:39
RWey22-Jun-21 10:39 
AnswerRe: UWP Flyout Problem Pin
Gerry Schmitz23-Jun-21 6:38
mveGerry Schmitz23-Jun-21 6:38 
AnswerRe: UWP Flyout Problem Pin
RWey25-Jun-21 6:38
RWey25-Jun-21 6:38 
QuestionDrawing a simple triangle horror when using std::vector Pin
Isawyouoo21-May-21 11:21
Isawyouoo21-May-21 11:21 
this is bullshit, the first VAO without std::vector get drawn but not the second with vector Confused | :confused: :
Vector3f Vertices[4];
Vertices[0] = Vector3f(-1.0f, -1.0f, 0.5773f);
Vertices[1] = Vector3f(0.0f, -1.0f, -1.15475f);
Vertices[2] = Vector3f(1.0f, -1.0f, 0.5773f);
Vertices[3] = Vector3f(0.0f, 1.0f, 0.0f);

unsigned int Indices[] = { 0, 3, 1,
1, 3, 2,
2, 3, 0,
0, 1, 2 };
GLuint VBO[2];
GLuint IBO[2];
unsigned int id[2];
glGenVertexArrays(2, id);
glGenBuffers(2, VBO);
glGenBuffers(2, IBO);

glBindVertexArray(id[0]);
glBindBuffer(GL_ARRAY_BUFFER, VBO[0]);
glBufferData(GL_ARRAY_BUFFER, sizeof(Vertices), Vertices, GL_STATIC_DRAW);

glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);

glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBO[0]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(Indices), Indices, GL_STATIC_DRAW);
struct Vertex
{
Vector3f position;
//Vector2f texCoord;
//Vector3f normal;
//int Boneindices[4];
//float Weights[4];
};

vector<vertex*> Vertices2;
Vertex* v=new Vertex();
v->position = Vector3f(-1.0f, -0.0f, 0);
Vertices2.push_back(v);
v->position = Vector3f(1.0f, -0.0f, -1);
Vertices2.push_back(v);
v->position = Vector3f(1.0f, -0.0f, 0);
Vertices2.push_back(v);
v->position = Vector3f(0.0f, 1.0f, 0.0f);
Vertices2.push_back(v);

struct Triangle
{
int indices[3];
};
Triangle* t = new Triangle();
t->indices[0]=0;
t->indices[1]=3;
t->indices[2]=1;
vector<triangle*> Indices2;
Indices2.push_back(t);
t->indices[0] = 1;
t->indices[1] = 3;
t->indices[2] = 2;
Indices2.push_back(t);
t->indices[0] = 2;
t->indices[1] = 3;
t->indices[2] = 0;
Indices2.push_back(t);
t->indices[0] = 0;
t->indices[1] = 1;
t->indices[2] = 2;
Indices2.push_back(t);

glBindVertexArray(id[1]);
glBindBuffer(GL_ARRAY_BUFFER, VBO[1]);
glBufferData(GL_ARRAY_BUFFER, sizeof(Vertex)* Vertices2.size(), &Vertices2[0], GL_STATIC_DRAW);

glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);

glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBO[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(Triangle)* Indices2.size(), &Indices2[0], GL_STATIC_DRAW);

for (size_t i = 0; i < 2; i++)
{
glBindVertexArray(id[i]);
glDrawElements(GL_TRIANGLES, 12, GL_UNSIGNED_INT, 0);
glBindVertexArray(0);
}
AnswerRe: Drawing a simple triangle horror when using std::vector Pin
Graham Breach21-May-21 21:03
Graham Breach21-May-21 21:03 
AnswerRe: Drawing a simple triangle horror when using std::vector Pin
Richard MacCutchan21-May-21 21:37
mveRichard MacCutchan21-May-21 21:37 
QuestionLooking for a C# option for doing simple 2D graphics Pin
MollyJanet13-May-21 8:45
MollyJanet13-May-21 8:45 
QuestionSharpDX MediaFoundation and DirectShow Pin
RWey15-Apr-21 4:22
RWey15-Apr-21 4:22 
AnswerRe: SharpDX MediaFoundation and DirectShow Pin
Dave Kreskowiak15-Apr-21 4:53
mveDave Kreskowiak15-Apr-21 4:53 
GeneralRe: SharpDX MediaFoundation and DirectShow Pin
RWey15-Apr-21 6:16
RWey15-Apr-21 6:16 
GeneralRe: SharpDX MediaFoundation and DirectShow Pin
Gerry Schmitz15-Apr-21 8:25
mveGerry Schmitz15-Apr-21 8:25 
GeneralRe: SharpDX MediaFoundation and DirectShow Pin
RWey15-Apr-21 9:35
RWey15-Apr-21 9:35 
GeneralRe: SharpDX MediaFoundation and DirectShow Pin
Dave Kreskowiak15-Apr-21 9:40
mveDave Kreskowiak15-Apr-21 9:40 
GeneralRe: SharpDX MediaFoundation and DirectShow Pin
RWey15-Apr-21 10:45
RWey15-Apr-21 10:45 
GeneralRe: SharpDX MediaFoundation and DirectShow Pin
K3 Reviews9-Oct-23 5:18
K3 Reviews9-Oct-23 5:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.