Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 858585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:33:42+00:00 2026-05-15T08:33:42+00:00

I need to draw lines using DrawPrimitiveUP and I need it to use the

  • 0

I need to draw lines using DrawPrimitiveUP and I need it to use the color value from my defined structure.

Important snippets from the code:

struct PointVertexColor
{
 float x, y, z;   // Position
 DWORD color;   //Colour
};

#define D3DFVF_PointVertexColor ( D3DFVF_XYZ | D3DFVF_DIFFUSE ) 

PointVertexColor myLines[1024];

device->DrawPrimitiveUP( D3DPT_LINELIST, myLinesCount, myLines, sizeof( PointVertexColor ) );

I have a pointlight set, lighting enabled and ambient lighting also.

Problem is that if I set up a material it uses the materials color and not the one from my data struct. How do I set it up so it uses the DWORD color and then set it back to use material for later code ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:33:43+00:00Added an answer on May 15, 2026 at 8:33 am

    The problem was obvious if you know it – you can’t use vertex color and lighting at the same time. The solution is to disable lighting for that part of the code and then re-enable it later.

    Hope it helps someone with the same question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to draw lines and dots (circles) in WFP. (VS 2010) I tried
I need a very simple function to draw a bunch of lines with anti-aliasing.
I'm using OpenGL ES on Android to draw some shapes, so I have some
I used to charts using core-plot framework, my requirement is draw vertical line as
I need to use (not implement) an array based version of Dijkstras algo .The
Important: we really need the stated functionality, so please don't start suggesting alternatives. We're
There is this site ... ... where they explain how to draw an antialiased
I want to draw a couple of simple bar plots to include in a
I am trying to drag a view over the screen FrameLayout main = (FrameLayout)
I tried googling and searching on stack but I didn't find anything :-( (

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.