Limiting FPS To Screen Refresh?

Apr 19, 2009

I have made a game (real time strategy) and it is running rather fast on my 3 GHz quad 8800 GTX, namely, it runs around 200 FPS usually when there are like 80 units and tanks in a forest fighting.

I would like to limit the FPS. So far my limitation code is pretty buggy... it does limit, but wrongly:

Private Sub LoopGame()
Do While GameIsNotPaused
FPS += 1

[Code]....

Also, after I solve this weird issue, should I set the value to monitor's refresh value which is usually 60 Hz on LCDs? Or should I set it to 30 or what ?

View 4 Replies


ADVERTISEMENT

Screen Blanks After 1 Min Of Processing (of Excel File) / Refresh Or Freeze Screen To Avoid Blank Screen?

Jun 29, 2011

BTW this issue occurs in any MS office program when the VB.Net (or even VBA) is processing information.Example: In Excel, a worksheet is displayed on the screen. I start either, a VB.Net or VBA procedure and within 30 seconds the Excel worksheet (previously displayed) blanks out. In both VB.Net and VBA,ScreenUpdating = False. My expectation is that the previously displayed screen would stay static as if I left my desk to get a cup of coffee; came back and the same ole Excel worksheet was still there?Of course, setting VBA Screen Updating = False accomplishes two goals: 1) speeds up processing and 2) saves the user from seeing unnecessary "garbage-processing" steps.Why does VBA or VB.Net ScreenUpdating = False not freeze the screen at the time of its invoking?

View 11 Replies

Use Of Progress Bar During Screen Refresh?

Jun 16, 2011

I have a Windows Form application that allows the user to delete several rows of textbox data at a time (i.e., using checkboxes). It takes a few seconds for this to occur and I was thinking about using a progress bar w/in the "delete rows" subroutine. It's also kind of "choppy" while the windows form refreshes. I'm new to this aspect of VB (2010) and how to make the screen refresh appear more professional. Apart from possibly using the progress bar, maybe there is also a way to dim the window until the refresh finishes?

View 5 Replies

GDI+: Update Or Refresh Only Certain Parts Of The Screen ?

Jan 30, 2010

I'm making a game using vb.net and GDI+. I've been encountering frame rate problems and one solution that was suggested to me was to only refresh certain parts of the screen. I was also told one way to make this happen was to use rectangle or region structures and since I already have these as hitboxes it seems like a perfect way to efficiently reduce the drop in frame rate.

The only problem is that I have no idea how this would work and so far my google searches have been fruitless. Yet again I turn to this very helpful forum, can anyone help me? By the way I've set doublebuffered to true on my form to get rid of the annoying flicker.

Questions. How do I update or refresh only certain parts of the screen?

I'm using a timer set to tick every millisecond to run everything and it refreshes the screen every 2 milliseconds simply using me.invalidate; each time it ticks things move a little bit and stuff happens that triggers other events etc. The problem is that when the framerate supposedly "drops" things start to change. "Bullets" and projectiles appear to travel many times faster and much less smoothly than they do when there a less objects moving on the screen, it's almost as if the timer runs faster... What's the reason for this? Is there a way I can change this? I remember hearing about a "stopwatch" or something that someone used in their game that was more consistent or something.

Also I'm aware that vb.net with GDI+ isn't exactly the best language to make a video game in but it's for a school project and I have no choice in the matter.

View 3 Replies

Screen Refresh Speed Is Not Fast Enough?

Jul 3, 2008

I am looking for help on how to speed up VB.NET (or C#) screen refresh speed. Specifically I need to update many controls and then refresh them on the screen all at once.I am in charge of writing a .NET interface for an older legacy program. Because this needs to run on slow legacy machines I did a performance test and discovered the screen refresh speeds of VB6 is faster then .NET. In VB6 there is barely a flicker as controls change across the entire form all at once. In VB.NET you can see controls change moving across the form like a wave. I must be doing something wrong...

To do a head to head comparison I put together equivalent VB6 and VB.NET programs, each with a maximized form and 48 labels. Clicking on any label changes the background color of all the labels on the form. To really see the problem it is best to try the following code on a slower machine (1GHz etc.)

In VB6 create a project MyProject and add a form MyForm with the following properties

Caption = "Screen Refresh test VB6"
BackColor = Black
WindowState = Maximized

On that form add a label MyLabel with the following properties:

Index = 0
Caption = "Hello World"
BackColor = Cyan

In the form add the following code:

[Code]...

View 8 Replies

[2005] Refresh The Whole Screen/desktop?

Feb 17, 2009

I need to refresh the whole screen/desktop.I am painting a rectangle and need to have it clean and not leaving marks when it is dragged around.There were a few claimed APIs that could do it. And then some others which were more specific to other languages.

View 5 Replies

Application To Refresh Screen And Change Resolution?

Nov 15, 2009

i wanted to develop a application to Refresh the screen.[Simple F5 would work !!] but is it possible.I want a button to start at X:0 Y:0 then on loading the form want the button to move diagonally on the form [ on reaching end the process should repeat ]I want the application that displays current resolution.The supported resolution by monitor and then give user the choice of selecting one.

View 2 Replies

Invalidating Splash Screen - Picture Box Doesn't Refresh With Image

Jun 21, 2010

I have a splash screen and want to test the loading bar. The % of loading are in 11 stages (0-100% in 10% intervals) and I have 11 different images. What i'm trying to do is set my picturebox.image = to the resource image and then wait 1 second then set picturebox.image to the next resource image. What i was doing is on the SplashScreen.Show method [Code]. What happens is that the picture box doesn't refresh with the image until the last image has been loaded from the procedure and the end of making the thread sleep completes. (this worked fine in VS2005). How can I make it load up the image, redraw the picturebox and then make the thread sleep for 1 second in VS2008.

View 4 Replies

Refresh Windows Form When Ever User Clicks Refresh Button?

Jun 5, 2009

Lets say i label "label1" , and 2 buttons named "button1" and "btnRefresh " [code]So , when user press the button 1 , the text will change. But what should i put inside btnRefresh to reload the forms ? and display the default label.text = "Form Load" ???

View 9 Replies

Limiting Access To A DLL In .NET

Feb 12, 2010

I write in-house software for a company. I always want to leverage OOP techniques as best as I can. In this thinking, I want to create a Data Access Layer (DAL) isolated in its own .DLL. What can I do to limit the access of the DAL DLL to only my business logic layer DLL? The last thing I need is someone in the company with a little programming knowledge plus access to the system (via Active Directory) to install .NET Express, reference my .DLL, and start firing off data access code outside of the real system. Are there any .NET mechanisms I can employ to limit a DLL to be used only by a pre-selected host application/DLL?

View 2 Replies

Limiting The Size Of A RTB?

Jan 30, 2011

My application allows the user to enter text into a RTB including all the various text font, size, etc changes. The user then prints that data onto a label. I got from my previous posts, I can print that on my label Each sheet has four labels, 3x5 inches. I print landscape and adjust margins to select the right label.But I want to limit the amount of text the usr can enter to the amount that will fit on the label. In essence, what I would like the user to see is a virtual label on the screen that they can type data into and get exactly the same formatting on the label when they print it.

I found several (mostly old) articles about linking the RTB to the printer, but nothing on how to set and limit the size of the RTB to the exact size of the label.

View 13 Replies

Limiting Textbox To Numbers Only?

Feb 20, 2012

I've made a lot of progress on my project. Only question I have now is how do I limit a textbox to only allow users to input numbers and one decimal point? The point of the decimal point is to make it currency. So if the answer of my calculation is 56.56566 I only want it to be $56.57.

View 5 Replies

Limiting The User Input?

Nov 21, 2010

sample of codes that i use to insert the data in my table, it works just fine but the problem is that i cant limit my user for example from entering null values, or integers into string or strings into integer,,,,, I also ask for assistance on how to handle any errors in my system from crashing.

Dim conn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "MOMSTEST.mdb;")
Dim Comm As New OleDb.OleDbCommand

[code]....

View 9 Replies

Sql - Meaningful String Limiting?

Oct 10, 2011

I've got rows in my table that contain text anywhere between 31 character and 281 characters long.Rather than display all this text in my table on my webpage, I'd like to limit this text to a few characters long so as to identify it to the user.What I've done is select left(ColumnName, 30) but this way is fairly ugly on the page as it cuts off the text in the middle of words.

View 2 Replies

Forms :: Limiting Sends Within Form?

Dec 14, 2011

i got a program that has clients send self typed messages via gmail and i want to be able to limit everyones use of this so they dont try to spam me, i want to make it so they can only send 1 from their computer every 12 hours how would i do this?

also i would like to make sure that one of the boxes they fill in has indeed been filled in with at least 20 characters before they can click the send button, hoping this would prevent ppl from sending blank messages

View 3 Replies

Limiting A Text Changed Event?

Jun 11, 2009

I have an number of text boxes and comboboxes on different forms. I have textchanged events which trigger a msgbox if the user enters invalid data(i.e. the number they enter is to big or to small). Is their a simple way to make the program not call the textchanged event when the form is loaded and the boxes get their initial value? Second is their a way to make the textchanged only be triggered when the user enters data not when the program clears the boxes?

View 3 Replies

Limiting Array Size Through Class?

May 29, 2009

Is it possible to have a UD Class that can limit how big it can grow as an array?

for example:dim var(10) as class this would throw an exception cause the class will only grow up to 5 elements.dim var(4) as class valid cause it is under the 5 element rule dim var(4, 10) as class invalid cause the 2nd dimension is above the 5 element rule. (would throw exception)

View 10 Replies

Limiting ComboBox Based On Database

Mar 30, 2012

I want to limit the number of students (60) that will be enrolled in one section and prompt a message that it surpass the limit. I inserted it in my combobox1

Here's my code :
strsql = "select * from Schedulings where Sections = '" & ComboBox1.Text & "'"
Dim acscmd As New OleDb.OleDbCommand
acscmd.CommandText = strsql
acscmd.Connection = asconn
acsdr = acscmd.ExecuteReader()
It doesn't work. How should I do it?

View 8 Replies

Limiting The Number Of Items In A List Box?

May 19, 2011

Does anyone know how to add a limit to the number of items in a list box? For example, you can't add more than 10 items in ListBox1.

View 2 Replies

Limiting User Selection In ListBox

Apr 30, 2011

This program allows a user to select a workshop and a destination, only one selection should be made. When I test I find I can add multiple of the same.

Private Sub ListBox1_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.Validated
If ListBox1.SelectedIndex = -1 Then
Beep()
MessageBox.Show("Select a workshop please.")
End If
[Code] .....

View 2 Replies

Limiting Values In An Object Property?

Dec 15, 2009

I have a class called Item which contains all the information about all parts, finished goods, in process parts (parts made on site), purchased parts, and raw materials.

I have a Bill of Materials table which has the following columns (reflected in the BOM class)

ParentItem
ChildItem
ChildItemQty

Parent Items can only be Items which have subcomponents.

Child Items can be parts that are made on site, purchased parts that are bought ready made from other companies, or raw materials used to make a part that is made on site.

Parent Items and child Items both inherit the Items class.

I will limit the Parent item class to only items that are in the parent column of the BOM table. I believe I can limit that by doing a quick look up on a view which only shows the parent items.

I will limit the Child Item Class to only items that are in the child column of the BOM table. Same method to limit it by doing a quick look up on a view that shows only the child items.

That way, an instance of the BOM class will have all the detail information about any of it's components available whenever I need them.

View 4 Replies

VS 2005 Limiting The DataGridView Rows?

Sep 6, 2009

I had a DataGridView in which i want to fetch the data from the access database,so i did this

Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Etech.mdb"
Dim myConnection As OleDbConnection = New OleDbConnection
myConnection.ConnectionString = connString

[Code]...

In the above snapshot,after fetching the data from the access database to the DataGridView,i want to remove the PplicyHolderName,PremiumAmount and a few other columns since these are the columns which do not contain any data....

View 6 Replies

VS 2010 : Limiting Values In A Textbox?

Apr 25, 2012

I have a textbox called textbox1. I wanted to limit it to only two characters, so I added the code TextBox1.MaxLength() = 2, however this textbox is for user input and only want to allow numeral values 0-99. And if the user entered a non-numerical value an exception would occur so I need help on to handle that.

View 2 Replies

VS 2010 Limiting Function Time

Nov 29, 2011

Currently I have calculated that one of my functions executes 62 times per second (on average). How can I limit this to say exactly 50 times a second (every time)?

View 3 Replies

VS 2010 Limiting Values In A Textbox?

May 12, 2012

I have a textbox called textbox1. I wanted to limit it to only two characters, so I added the code TextBox1.MaxLength() = 2, however this textbox is for user input and only want to allow numeral values 0-99. And if the user entered a non-numerical value an exception would occur

View 3 Replies

.net - Limiting The Mouse To A Form Without The Ability To Override?

Dec 29, 2009

So I am trying to make a program where the user is limited in moving the mouse to a form. I still want the user to see whats going on behind the form but not be able to click on anything but my form.

I tried using this

Cursor.Clip = Me.RectangleToScreen(Me.ClientRectangle)

The problem is that if the user clicks in certain spots on the titlebar...the mouse is unlocked. The machines this is going on has a ball type of mouse so if you scroll fast and click fast enough...it can also unlock.

View 3 Replies

Limiting A Textbox To Enter 10 Digit Number Only?

Oct 15, 2011

how can i limit a user to enter 10 digit no like telephone no in textbox without using regular expressions?

View 12 Replies

Limiting Textbox To Enter 10digit Number Only?

Oct 9, 2011

how can i limit a user to enter just 10 digit number (minimum 8 but not more than that 10 in any case) in a textbox(like telephone no)?

View 4 Replies

Limiting The Amount Of Numbers To Two After A Decimal Point?

Jan 26, 2012

I am trying to restrict the the number of decimal places to two in a textbox.

I've already made it so only numbers and decimals can be added, now this is the only thing that isnt done

Private Sub MoneyTxtxbx(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles _
MoneyTxtbx.KeyPress

[Code]....

View 2 Replies

VS 2005 - Limiting The Combobox Drop Down List

Sep 18, 2009

My combobox dropdownlist contains 60 to 65 items. So i want to show 5 items in the dropdownlist of my combobox and add a vertical scroll bar in it so that the user can scroll it and see the items. How to add a vertical scroll bar in the combobox dropdown list? I want to add this vertical scroll bar only when the dropdown list contains more than 5 items.

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved