ria pc game
fle game engine -
fle game engine -


Balls and holes PC game / Balls and Holes PC
Dragonella   17.09.2020  /
Today
28 2023 1:50
   ?

Eternity - megainformatic - Windows Sockets 2, ping, Windows SDK 7, hxs - 4
Eternity - megainformatic - 4   1 2 3 4   * * * - BE
...

, , , , , photshop, php, c++, , delphi, cms,

Creating game on fle game engine - DirectX 9c Draw Line - This can be helpful



The purpose of this lesson is simple - to show how use directx 9c for drawn line.

It is sometimes necessary. For example in the Scene Editor in this way is drawn a grid, serving for accurate positioning of game objects in the scene.

Creating game on fle game engine - DirectX 9c Draw Line - This can be helpful

The documentation for directx 9c is ID3DXLine interface, and its methods to be used to draw lines.

However, there is no a full example of how to apply it all together.

We fill this gap, and at the end of the lesson, you can download the finished result.

All you need - is to have a basic source code to create a simple application directx 9c (it you too will be able to download), as well as a few dozen lines of code that will be required to perform a line drawing with directx 9c.

The bottom line is this:

Module start.h inside CD3DGameApp class declares the following fields and methods:

//draw line
ID3DXLine* m_pLine;
void CreateLine(IDirect3DDevice9* pd3dDevice);
void LineOnLostDevice();
void LineOnResetDevice();
void FillPixel(int x, int y, int w, int h, DWORD color);
void FreeLine();
void DrawPoint(float x, float y, DWORD color);
void DrawLine(float x, float y, float x2, float y2, float width, DWORD color);

Module start.cpp implement them.


CD3DGameApp::CD3DGameApp()
{
//...
m_pLine = NULL;

void CD3DGameApp::CreateDeviceObjects(IDirect3DDevice9* pd3dDevice) { CreateLine(pd3dDevice); } HRESULT CD3DGameApp::RestoreDisplayObjects(IDirect3DDevice9* pd3dDevice) { //... LineOnResetDevice(); } HRESULT CD3DGameApp::DestroyDisplayObjects() { //... FreeLine(); } HRESULT CD3DGameApp::InvalidateDisplayObjects() { //... LineOnLostDevice(); } //draw line
void CD3DGameApp::CreateLine(IDirect3DDevice9* pd3dDevice)
{
D3DXCreateLine(pd3dDevice, &m_pLine);

}

void CD3DGameApp::LineOnLostDevice()
{
if ( m_pLine != NULL )
{
m_pLine->OnLostDevice();
}
}

void CD3DGameApp::LineOnResetDevice()
{
if ( m_pLine != NULL )
{
m_pLine->OnResetDevice();
}
}

void CD3DGameApp::FillPixel(int x, int y, int w, int h, DWORD color)
{
D3DXVECTOR2 vLine[2];

if ( m_pLine != NULL )
{

m_pLine->SetWidth( (float)w );
m_pLine->SetAntialias( false );
m_pLine->SetGLLines( true );

vLine[0].x = (float)(x + w/2);

vLine[0].y = (float)y;
vLine[1].x = (float)(x + w/2);
vLine[1].y = (float)(y + h);

m_pLine->Begin();
m_pLine->Draw( vLine, 2, color );
m_pLine->End();

}

}

void CD3DGameApp::FreeLine()
{
SAFE_RELEASE( m_pLine );
}

void CD3DGameApp::DrawPoint(float x, float y, DWORD color)
{
FillPixel((int)x, (int)y, 1, 1, color);
}

void CD3DGameApp::DrawLine(float x, float y, float x2, float y2, float width, DWORD color)
{
D3DXVECTOR2 vLine[2];

if ( m_pLine != NULL )
{

m_pLine->SetWidth( width );
m_pLine->SetAntialias( false );
m_pLine->SetGLLines( true );
vLine[0].x = x;
vLine[0].y = y;
vLine[1].x = x2;
vLine[1].y = y2;
m_pLine->Begin();
m_pLine->Draw( vLine, 2, color );
m_pLine->End();

}
}

void CD3DGameApp::DrawGameView() { //draw line DrawPoint(30.0f, 30.0f, 0xFFFF0000); DrawLine(10.0f, 50.0f, 300.0f, 50.0f, 1.0f, 0xFFFFFF00); DrawLine(80.0f, 210.0f, 400.0f, 120.0f, 2.0f, 0xFF00FF00); DrawLine(500.0f, 310.0f, 200.0f, 80.0f, 1.0f, 0xFFFFC017); }

That's all ! So we learned to draw points and lines of any color and position. The color code can be used and the alpha - the first pair of numbers, it will set the translucency of the depicted primitives. 0xFFFFC017 - FF - alpha value i. e. 255.

Line Object - m_pLine passes all the same stages as any other directx 9c Object: creating CreateLine, LineOnResetDevice reset, invalidation LineOnLostDevice, Freeline freeing, and of course drawing DrawLine. If you want to animate a line, then you will still need to implement the method of animation, such as AnimLine, called from the method CD3DGameApp::FrameMove of your application.

Download Example Draw Line with full source code (524 Kb).





To build the project normally, you will need an DX SDK Aug 2008 and MSVS 2005 development environment

Read more about the project settings refer to the attached inside the self-extracting archive file readme.txt

to content

:
0
!
0
 !


     
  ,
enterra   java libgdx -
enterra 3d   godot 3.5.1 -
   2023
   
   
     
     
     
     
  ,
Kate Ryan - Ella Elle L'a
sexonix
: dress - hordes pc  free  -
: dress -   - parallel reality -  -   Win, Linux,   android
   
     
     
     
  , , 2020 - ,
  gdess 2 -
ciao 2020 -  2020 -
One Way The Elevator     Dr. Perec !!!
   
     
     
  , , , .
          -   ,   ( delphi, c++, html5), ,    ,        -   1  -    14
    2006
  -      -
   
     
     
 
Witches Trainer 1.6 and Innocent Witches 0.1 -      -
Futa in the Police Academy -
gdess c
gdess2
   
     
 
Prince of Persia , , , adventure
Dreams Reality
Little Office Trouble
Tetris
   
     
     
 
Neon Battle Tank 2
Robocop
Robocop (Ocean )
Karateka ,
   
     
     
 
Prehistorik 2 -
    15 -   The Dreik, megainformatic, ,
  Mega game
Black planet   -   ,
   
     
     
 
Teenage Mutant Ninja Turtles II
2 nights
Wolfenstein 3D -
Golden Axe -
   
     
     
  (3), (1)
Aladdin
Surprise! Adlib Tracker 2 (sadt 2)
Lamborghini ,
Risky Woods
   
     
     
 
Black Box horror
  logic
Fire power
Red Ball Forever
   
     
     
 
Teresa - dos
Shadow Knights
-0010.01
0010.01 - !
The Cycles - International Grand Prix Racing
   
     
     
 
Fantastic Dizzy adventure
Ugh!
Budokan: The Martial Spirit - fighting
Vida -
   
     
     
  (3), (1)
 Starcraft
Inspace
Key shield
Team Ninja Unkende 4 - Ninja Gaiden 4   pc
   
     
     
 
Laser Adventures - fast hardcore shooter
      !!!
Ninjuzi -  neo shooter
Plants vs Zombies 3 tower defence
   
     
  ,
Shmupnage - cosmos shooter
Undercat pc
Cold station - shooter, survival
Cut the rope - ,
   
     
     
 
Crown Dungeon 2
dragonella
crush shooter
grievous medical shooter
   
     
     
 
Foxyland 2
Foxyland 2
quidget 2
quidget 2
  ,  !
Pigglet   , english
   
     
  ,
Google Media Grabber -
Anova
anova
A Knots Story
A Knots Story
Sabotage
sabotage
   
     
  ,
24500 .
satellite /  -
ria pc game robocop
star inheritance    zx spectrum
   
     
  ,
ria pc game - pink dreams come true -
/
      24.09.2019
     - megainformatic live chat
5500 .
Game Builder -
   
     
  , ,
     6
      ?
 -
150 .
   
     
  , ,
   -    -   (kk hny) -
  -   -   (kk scp) -
  2013  megainformatic  ru
    -
   
     
  , , cms,
 freeware     / Balls on lif +    / How make a game
250 .
   megainformatic cms admin files  mysql
1250 .
   -     -   (akk hiss)
350 .
   
     
  ,
dream world -  2d    fle game engine - c++  directx 9
  -   (kk kz) -
  -
   fle game engine - Simple game
   
     
  , , ria xxl , fly snow 3d , . -
    -    PC / Balls and Holes - Green Ball Holidays PC game
ria xxl -  4.09.2019
150 .
fle game generator - fle   - fly snow 3d    1.0.3.1  13.12.2016 -
350 .
 
     
  fle game engine -
fle game engine         Windows Directx 9c -
800 .
 PC  / Ria PC game
240 ./
     1   / Balls on Lift Level 1 Run The Lift  0.9.2 05.10.2016 / version 0.9.2 05.10.2016
 
     
  - / megainformatic cms express files -
 /
700 .
1250 .
larry xxl     4.09.2019
150 .
   -04     7.07.2019
500 .
 
     
  Flash, Flash - .
 Flash
 flash
    cms
2500 .
megainformatic cms rs
14000 .
 
     
  (multi lang), , . - (megainformatic cms social), megainformatic cms groupon, keywords gen + , .
500 .
megainformatic cms social
12000 .
megainformatic cms groupon
14000 .
 -

megainformatic.ru/webjob/ - -

 
 

megainformatic.ru/webjob/

megainformatic.ru/webjob/
webjob
template selector
350 .
megainformatic cms express files +  slider
300 .

megainformatic.ru/webjob/ - -

 
     
 

,

megainformatic cms admin
1250 .
 delphi direct x 3d
megainformatic cms seo
550 .
megainformatic cms stat kit
500 .

megainformatic cms admin -

 
     
 
megainformatic cms express
350 .
megainformatic cms e-mailer
5800 .
megainformatic cms e-shop
3000 .
megainformatic cms e-pro
500 .
 
 
 
 
     
     
 

megainformatic cms free - Photoshop

megainformatic cms free
 photoshop
650 .
 photoshop -  !
700 .
 photoshop -
750 .

, Adobe Photoshop. , - GIMP, Corel Photo Paint .

 

 
 
     
 

2d 3d, , !

  ,  !
500 .
Donuts 3D
:

. , , !!! ( , ! ).

 
     
 
 
 
     
 

, : -

  -
350 .
  -
510 .
   ?
fle game engine
:  -

- , , , . - - : -

 
     
 
 
 
     
 

, 3ds max, photoshop, c++, directx, delphi php.

 3ds max
 c++  directx
 php
 3d   delphi directx
500 .
300 .

, .

.

 
     
 
 
 
     
     
 

   , !  delphi directx
  CJ andy -    mp3
 Photoshop free ( )
megainformatic cms express -     php + my sql
400 .

Photoshop free, delphi directx - , !, mp3 - , megainformatic cms express - php + my sql.

 
     
 
 
 
     
 

,

450 .
 Delphi Directx 8.1
   3d studio max
   FL Studio

, delphi directx 8.1 ( 3d ), 3d studio max, - Fruity Loops Studio

 
     
 
 
 
     
     
     
 
megainformatic cms express files

- megainformatic cms express files

megainformatic cms express files - , . mysql. . php, my sql.

- !!!

3 , , .

...

 
 

Registered comments


fle game engine -
fle game engine -


Something: Unexplained 2 captive of desires / :  2
     - 6 , 81 , 220 mp3
Quidget 2    -  , english
megainformatic
: 0,1366