|
So I'm aware of MonoGame, SharpDx, etc, but these are all significant overkill for what I need, and what's more, none of them work over the remote desktop protocol.
I'm just wanting to do some very simple 2D graphics, and it doesn't even have to run at a particularly high frame rate (even 20FPS is fine). But most importantly, it has to work over the RDP, which means it has to be software rendering.
I have played with a WritableBitmap with some degree of success, but was wondering if anyone had any other ideas?
Obviously, this isn't for any sort of "real" game or anything. Just basically an exercise to keep me from forgetting how to use C#.
|
|
|
|
|
I'm somewhat new to DirectX programming and need a bit of guidance. My requirement is currently limited to video and 2D drawing and so far I've managed to get SharpDX to play a video from a file without problems, and also have been able to do my 2D drawing. This was simple enough and the performance is good.
Ultimately, my video source will need to be video input devices ( i.e. web cams, video capture cards, etc. ).
My question is: Does SharpDX.MediaFoundation include DirectShow wrappers such that I can access and play video from local video input devices? If so, can someone point me in the right direction and link some examples of using SharpDX for this purpose?
Many thanks.
|
|
|
|
|
Quote: NOTE: As of 29 Mar 2019, SharpDX is no longer being under development or maintenance Are you sure you still want to go down SharpDX path?
Sadly, the only .NET wrapper for DirectX anything that I know of, that is still in development, DirectN[^].
|
|
|
|
|
I understand it's no longer supported, but it's battle tested and I don't think the risk at present is any greater than investing in the "latest and greatest" GUI framework only to have it killed off before it gets off the ground.
Besides, I feel if I use SharpDX to get a better handle on the underlying concepts, porting to something new(er) when required would be easier.
As to my original question, I know there's other NuGet packages that make easy work of displaying camera input ( i.e. AForge, Accord ), but I'm not convinced they're taking full advantage of the GPU, which is what I'm looking for. Specifically, I need to route the capture byte stream directly to the mediaengine's render surface as I'll be dealing with larger sizes and framerates.
Regards,
R. Wey
|
|
|
|
|
|
I'm using WinForms (yeah, I know ... old school), tho I don't think that makes much difference as in the end its simply the window/control Handle that has to be specified as the swapchain.OuputHandle. I'm doing that already for playing a video file as a test and performance is very good.
When looking through SharpDX.MediaFoundation with Reflector, I get the strong feeling it provides the means for capture input, but I can't find any complete examples in that specific area.
Regards,
R. Wey
|
|
|
|
|
And herein lies the problem with using a library that's been dead in the water for two years, lack of support.
I can't help you as I've never used the thing.
|
|
|
|
|
No problem. Given that it saw over 2.5 million downloads, I figured there might be somebody that used it for this purpose and I don't think DirectX11 is going anywhere any time soon.
As for newer platforms, I unfortunately don't have a lot of experience with them so I'm concerned about the stumbling block that would present and not knowing their limitations. I could struggle my way thru UWP, but using what accelerated graphics API? Win2D? WinUI3? DirectN ?
It's hard to know which platform to choose that will still be around by the time I learn it.
Regards,
R. Wey
|
|
|
|
|
|
|
I am creating a game with pygame and an image won't show up until the window is loading to be closed. This is my code so far:
import pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("ALix")
icon = pygame.image.load("nater.jpg")
pygame.display.set_icon(icon)
playerImg = pygame.image.load('nater.jpg')
playerX = 400
playerY = 300
def player():
screen.blit(playerImg, (playerX, playerY))
running = True
while running:
screen.fill((255, 255, 255))
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
player()
pygame.display.update()
modified 13-Jul-20 3:22am.
|
|
|
|
|
I do not know pygame but I notice that you do not call pygame.display.update() until the end of the program. In most GUI applications you need to call update during normal running in order to keep it current.
|
|
|
|
|
I have run into a dead end in another OpenGL forum.
I have a basic understanding how (OpenGL) stencilling works.
My stencil is in 2D , no depths.
I am extracting a (circular) part of OpenGL objects, no problem.
I am trying to further manipulate the stencil result.
The task is to enlarge the result and move it to the center of the screen.
I used glTranslatef but it moves the original stencil, not the result. I want to move the result only.
I think my issue is that the stencil was build in "top of the modleview matrix" ( no push /pop) and the objects to be stencilled are in various matrix "stack" - used push / pop.
I understand the "result" is in color buffer, but it sure looks as I am manipulating the stencil buffer, which has been already disabled.
Am I correct in all this?
Do I have to rebuild all on SAME matrixview stack level ?
I am sorry if I am not using correct OpenGL terminology.
Cheers
|
|
|
|
|
First - to avoid "confusion" - I am using term "object" to describe what is created in OpenGL in-between "new " and "end" loop code.
I have a "text (object)" rendered (in OpenGL window) , I need to delete such text and replace it with another one.
I do no want to translate , rotate etc. ... just delete and replace.
What I have tried so far ALWAYS writes OVER the existing text and makes a mess.
Is that possible in OpenGL?
I think I'll try (a hack ) - moving / translating current(text) matrix off the screen....
Open to other ideas.
Cheers
|
|
|
|
|
This is just a wild guess because I can't see your code - are you missing a call to glClear in your render loop?
|
|
|
|
|
As a general "rule" NOT to invite uncalled for criticism on my under construction code I am therefore very reluctant to post code.
However, every rule has an exception so here is the latest implementation of "write text message" to OpenGL window.
It writes the message, but in wrong position - irrelevant for now.
(The disabled #ifdef / #endif code was added and that is why the message is written in wrong raster position.The raster position code must be in wrong place. )
It is my understanding that OpenGL keeps the data - bitmap in this case - in video card hardware. So to override / update the data I have to access that particular hardware .
Or in another words - OpenGL "variable / object" cannot be just overwritten like C code.
So I believe I need to keep track of "matrix" where the initial bitmap is written and then
glLoadIdentity(); should clear the entire matrix.
Correct me if I am wrong, but glClear would not work SELECTIVELY , it would clear entire buffer.( I did neglected to add "selectively" to the post title )
<pre>void OpenGL_text(char *message, float x, float y, float z) {
printf("\nOPENGL TRACE OpenGL @function %s @line %i \n", __FUNCTION__,
__LINE__);
printf("\nOPENGL TRACE STOP passed message %s @line %i\n", message,
__LINE__);
char menu[80];
strcpy(menu, message); int len;
len = strlen(menu);
glColor3f(1, 1, 1);
{ glMatrixMode( GL_PROJECTION); glPushMatrix(); glLoadIdentity();
gluOrtho2D(0, 500, 0, 500); { glMatrixMode( GL_MODELVIEW);
glPushMatrix();
glLoadIdentity(); glRasterPos3f(x, y, z);
for (int i = 0; i < len; ++i) {
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, menu[i]);
}
glPopMatrix(); } glMatrixMode( GL_PROJECTION);
glPopMatrix();
} glMatrixMode( GL_MODELVIEW);
}
|
|
|
|
|
Yes, glClear does clear the whole viewport - you would then redraw all of the content for the next frame. Matrices only affect what you are going to render in the future, not what you have already sent to be rendered.
|
|
|
|
|
Since I just discover that push / pop matrix is "deprecated " clearing all maybe the only decent option anyway. Really not that hard since I keep system state...
Bottom line OpenGL was not the best choise for my application. O well...
Thanks
|
|
|
|
|
Here is the class ->
class bullet
{
private:
public:
void update();
bool check()
{
if(y>=box_len/2)
{
return true;
}
return false;
}
void draw();
};
vector <bullet*> bullets;
Here is the update function ->
void update(int value)
{
for( typeof(bullets.begin()) it= bullets.begin(); it!= bullets.end();it++)
{
if((*it)!=NULL)
{
if(*it)->check())
{
delete *it;
bullets.erase(it);
}
}
}
glutTimerFunc(10, update, 0);
}
|
|
|
|
|
|
I am going to use graphviz to generate state flow charts (i.e. blobs representing states, arrows from one blob to another representing events/transtions) based on a transition table.
There are ways to give hints about the preferred placements, in rough terms, through the "rank" specification. That is not defining the placements, just one input parameter to the placement algorithm. Ideally, I would like to give the user a mechanism to drag one or more blobs to a different position, and then redo the layout but with this one blob pinned.
I do not have the time do decipher the placement algorithm from the source code , so now I hope that either someone knows graphviz in great detail, or the placement algorithms: Is pinning of individual graphic elements at all compatible with the placement algorithm? If it is, can this be done in the dot input language to graphviz? Or in some other way?
|
|
|
|
|
I can not know which is the best free tool for create infographics.
I want to know about this. Please provide me
Best tool or site to create eye catching infographics
|
|
|
|
|
|
Hello,
I am trying to develop a 2D graphics editor on C#.
In that editor I want continuous co-ordinates where ever the mouse hovers.
I tried using Graphics class in C# but it uses the screen co-ordinates.
Instead I want to use world co-ordinates to draw different shapes.
(Some what like a Autocad Editor, but I don't want to include the complex functionalities)
How can I achieve that?
|
|
|
|
|
Member 14558696 wrote: How can I achieve that? With a lot of hard work. And what do you mean by, "I want to use world co-ordinates to draw different shapes."? It does not matter what co-ordinate system you use, drawing a shape is much the same process.
|
|
|
|